fix(ticket): complete stale request guards

This commit is contained in:
mlogclub
2026-05-02 20:23:32 +08:00
parent 8102f89308
commit 872f28fd3f
2 changed files with 23 additions and 12 deletions
@@ -43,7 +43,8 @@ func (c *TicketController) AnyList() *web.JsonResult {
if unassigned, _ := params.Get(c.Ctx, "unassigned"); unassigned == "1" || strings.EqualFold(unassigned, "true") {
cnd.Eq("current_assignee_id", 0)
}
if staleHours, _ := params.GetInt(c.Ctx, "staleHours"); staleHours > 0 {
if staleHoursValue, _ := params.Get(c.Ctx, "staleHours"); strings.TrimSpace(staleHoursValue) != "" {
staleHours, _ := params.GetInt(c.Ctx, "staleHours")
services.TicketService.ApplyStaleFilter(cnd, staleHours)
}
aggregate, err := services.TicketService.FindPageAggregateByCnd(cnd, operator.UserID)