mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-22 14:25:45 +00:00
Merge branch 'fix/filter-po' into 'development'
fix See merge request mbugroup/lti-api!549
This commit is contained in:
@@ -264,6 +264,14 @@ func (s *purchaseService) GetAll(c *fiber.Ctx, params *validation.Query) ([]enti
|
||||
|
||||
sortBy := strings.TrimSpace(params.SortBy)
|
||||
sortOrder := strings.ToUpper(strings.TrimSpace(params.SortOrder))
|
||||
|
||||
if sortBy == "" && (filterBy == "po_date" || filterBy == "due_date" || filterBy == "received_date" || filterBy == "created_at") {
|
||||
sortBy = filterBy
|
||||
if sortOrder == "" {
|
||||
sortOrder = "ASC"
|
||||
}
|
||||
}
|
||||
|
||||
if sortOrder == "" {
|
||||
sortOrder = "DESC"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user