update: add pool query to package page

This commit is contained in:
ngn
2024-08-26 00:51:20 +03:00
parent 6815f1a762
commit 5bf6876558
3 changed files with 21 additions and 3 deletions

View File

@ -12,6 +12,7 @@ func GET_package(c *fiber.Ctx) error {
var (
name string
version string
pool string
list *[]lib.Package
)
@ -21,11 +22,11 @@ func GET_package(c *fiber.Ctx) error {
list = c.Locals("list").(*[]lib.Package)
version = c.Params("version")
name = c.Params("name")
pool = c.Query("p")
for _, pkg := range *list {
if pkg.Name != name || (version != "ANY" && pkg.Version != version) {
if pkg.Name != name || (version != "ANY" && pkg.Version != version) || (pool != "" && pkg.Pool.ID() != pool) {
continue
}
if is_download {