Refactor Filter options into a struct

It was already a lot of options for one method and I am going to add
another one in the next commit.
This commit is contained in:
Gordian Schoenherr committed 2024-12-09 13:17:41 +09:00
1 parent 88ef8efba5
commit 3b785e4165
12 files changed
+167 -71

No files matched your search

+6 -2
View File
@@ -306,8 +306,12 @@ func apiMirrorsPackages(c *gin.Context) {
list.PrepareIndex()
list, err = list.Filter([]deb.PackageQuery{q}, withDeps,
nil, context.DependencyOptions(), architecturesList)
list, err = list.Filter(deb.FilterOptions{
Queries: []deb.PackageQuery{q},
WithDependencies: withDeps,
DependencyOptions: context.DependencyOptions(),
Architectures: architecturesList,
})
if err != nil {
AbortWithJSONError(c, 500, fmt.Errorf("unable to search: %s", err))
}