Search: default to active if no params

This commit is contained in:
William Bouzourène 2025-03-26 18:56:22 +01:00
parent 7ba325bcee
commit 656c06d5ce
Signed by: bouzoure
SSH key fingerprint: SHA256:19MbXpLua4rUtk8tunMesD8KUKb91LXLHg8E/qTooww
2 changed files with 24 additions and 0 deletions

View file

@ -58,6 +58,12 @@ func Contacts(c *fiber.Ctx) error {
} }
} }
// If active and archive are false, default to active
// This needs to be placed before the security verification
if !params.Active && !params.Archive {
params.Active = true
}
params.PageNumber, _ = strconv.Atoi(c.Query("p")) params.PageNumber, _ = strconv.Atoi(c.Query("p"))
params.PageSize = 50 params.PageSize = 50
params.PersonType = "contacts" params.PersonType = "contacts"
@ -140,6 +146,12 @@ func ContactsExport(c *fiber.Ctx) error {
} }
} }
// If active and archive are false, default to active
// This needs to be placed before the security verification
if !params.Active && !params.Archive {
params.Active = true
}
params.PageSize = 0 params.PageSize = 0
params.PersonType = "members" params.PersonType = "members"

View file

@ -73,6 +73,12 @@ func Members(c *fiber.Ctx) error {
} }
} }
// If active and archive are false, default to active
// This needs to be placed before the security verification
if !params.Active && !params.Archive {
params.Active = true
}
params.PageNumber, _ = strconv.Atoi(c.Query("p")) params.PageNumber, _ = strconv.Atoi(c.Query("p"))
params.PageSize = 50 params.PageSize = 50
params.PersonType = "members" params.PersonType = "members"
@ -155,6 +161,12 @@ func MembersExport(c *fiber.Ctx) error {
} }
} }
// If active and archive are false, default to active
// This needs to be placed before the security verification
if !params.Active && !params.Archive {
params.Active = true
}
params.PageSize = 0 params.PageSize = 0
params.PersonType = "members" params.PersonType = "members"