adjust get all phase activity

This commit is contained in:
MacBook Air M1
2026-01-08 13:37:53 +07:00
parent f1f7edb9ab
commit f079bee92a
3 changed files with 26 additions and 15 deletions
@@ -28,20 +28,12 @@ func (u *PhaseActivityController) GetAll(c *fiber.Ctx) error {
Limit: c.QueryInt("limit", 10),
Search: c.Query("search", ""),
}
query.PhaseIDs = c.Query("phase_ids", "")
if query.Page < 1 || query.Limit < 1 {
return fiber.NewError(fiber.StatusBadRequest, "page and limit must be greater than 0")
}
if phaseParam := c.Query("phase_id", ""); phaseParam != "" {
id, err := strconv.Atoi(phaseParam)
if err != nil || id <= 0 {
return fiber.NewError(fiber.StatusBadRequest, "invalid phase_id")
}
temp := uint(id)
query.PhaseId = &temp
}
result, totalResults, err := u.PhaseActivityService.GetAll(c, query)
if err != nil {
return err