aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/api/graphql/resolvers/resolver.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/api/graphql/resolvers/resolver.go b/pkg/api/graphql/resolvers/resolver.go
index bb66854..2712cf1 100644
--- a/pkg/api/graphql/resolvers/resolver.go
+++ b/pkg/api/graphql/resolvers/resolver.go
@@ -233,6 +233,10 @@ func (r *queryResolver) PackageSearch(ctx context.Context, searchTerm *string, r
Select()
}
+ if len(gpackages) > 1 && (gpackages[0].Atom == *searchTerm || (gpackages[0].Name == *searchTerm && gpackages[1].Name != *searchTerm)) {
+ return gpackages[:1], nil
+ }
+
if err != nil {
return nil, errors.New("an error occurred while searching for the packages")
}