mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
adjust get all phase activity
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user