mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
add sorting at marketing
This commit is contained in:
@@ -56,6 +56,12 @@ func (u *DeliveryOrdersController) GetAll(c *fiber.Ctx) error {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "Invalid product_ids")
|
||||
}
|
||||
|
||||
sortBy := strings.TrimSpace(c.Query("sort_by", ""))
|
||||
sortOrder := strings.TrimSpace(c.Query("sort_order", ""))
|
||||
if sortOrder == "" {
|
||||
sortOrder = "asc"
|
||||
}
|
||||
|
||||
query := &validation.DeliveryOrderQuery{
|
||||
Page: c.QueryInt("page", 1),
|
||||
Limit: c.QueryInt("limit", 10),
|
||||
@@ -66,6 +72,8 @@ func (u *DeliveryOrdersController) GetAll(c *fiber.Ctx) error {
|
||||
MarketingId: uint(c.QueryInt("marketing_id", 0)),
|
||||
ProjectFlockID: uint(c.QueryInt("project_flock_id", 0)),
|
||||
ProjectFlockKandangID: uint(c.QueryInt("project_flock_kandang_id", 0)),
|
||||
SortBy: sortBy,
|
||||
SortOrder: sortOrder,
|
||||
}
|
||||
|
||||
if isAllExcelExportRequest(c) {
|
||||
|
||||
Reference in New Issue
Block a user