Search: default to active if no params
This commit is contained in:
parent
7ba325bcee
commit
656c06d5ce
2 changed files with 24 additions and 0 deletions
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue