Add FilterValue to search options
This commit is contained in:
parent
02a6104fb0
commit
1b8c05b257
|
@ -76,10 +76,11 @@ func convertPkg(p db.Package) Package {
|
||||||
|
|
||||||
// Options contains the options for a search.
|
// Options contains the options for a search.
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Filter Filter
|
Filter Filter
|
||||||
SortBy SortBy
|
FilterValue string
|
||||||
Limit int64
|
SortBy SortBy
|
||||||
Query string
|
Limit int64
|
||||||
|
Query string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search searches for packages in the database based on the given options.
|
// Search searches for packages in the database based on the given options.
|
||||||
|
@ -94,7 +95,7 @@ func Search(opts Options) ([]Package, error) {
|
||||||
case FilterSupportsArch:
|
case FilterSupportsArch:
|
||||||
query += " AND json_array_contains(architectures, ?)"
|
query += " AND json_array_contains(architectures, ?)"
|
||||||
}
|
}
|
||||||
args = append(args, opts.Filter)
|
args = append(args, opts.FilterValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.SortBy != SortByNone {
|
if opts.SortBy != SortByNone {
|
||||||
|
|
Loading…
Reference in New Issue