mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 06:45:43 +00:00
fix: add include_all param in get all master product
This commit is contained in:
@@ -38,6 +38,14 @@ func (u *ProductController) GetAll(c *fiber.Ctx) error {
|
||||
query.IsDepletion = &value
|
||||
}
|
||||
|
||||
if includeAllParam := c.Query("include_all", ""); includeAllParam != "" {
|
||||
value, err := strconv.ParseBool(includeAllParam)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "invalid include_all value")
|
||||
}
|
||||
query.IncludeAll = &value
|
||||
}
|
||||
|
||||
if query.Page < 1 || query.Limit < 1 {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "page and limit must be greater than 0")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user