fix: add order_by and sort_by query to master data employee

This commit is contained in:
ValdiANS
2026-05-04 16:28:03 +07:00
parent 19d7cd33ca
commit 48351661c5
3 changed files with 19 additions and 7 deletions
@@ -24,9 +24,11 @@ func NewEmployeesController(employeesService service.EmployeesService) *Employee
func (u *EmployeesController) GetAll(c *fiber.Ctx) error {
query := &validation.Query{
Page: c.QueryInt("page", 1),
Limit: c.QueryInt("limit", 10),
Search: c.Query("search", ""),
Page: c.QueryInt("page", 1),
Limit: c.QueryInt("limit", 10),
Search: c.Query("search", ""),
OrderBy: c.Query("order_by", "desc"),
SortBy: c.Query("sort_by", "updated_at"),
}
if query.Page < 1 || query.Limit < 1 {