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
2024-11-26 16:19:23 +09:00
parent 88ef8efba5
commit 3b785e4165
12 changed files with 167 additions and 71 deletions
+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))
}