Handle nil FilterValue

This commit is contained in:
Elara 2023-09-22 16:41:43 -07:00
parent 54da212c32
commit d785271d16

View File

@ -32,13 +32,18 @@ import (
type lureWebAPI struct{}
func (l lureWebAPI) Search(ctx context.Context, req *api.SearchRequest) (*api.SearchResponse, error) {
pkgs, err := search.Search(search.Options{
opts := search.Options{
Filter: search.Filter(req.FilterType),
FilterValue: req.FilterValue,
SortBy: search.SortBy(req.SortBy),
Limit: req.Limit,
Query: req.Query,
})
}
if req.FilterValue != nil {
opts.FilterValue = *req.FilterValue
}
pkgs, err := search.Search(opts)
return &api.SearchResponse{Packages: searchPkgsToAPI(ctx, pkgs)}, err
}