Fix backend API parity: document filters, task days param, i18n locales, contract tests
- Add document list filter support (residence, type, category, contractor, is_active, expiring_soon, search) to handler/service/repo - Add `days` query param parsing to ListTasks handler (matches ListTasksByResidence) - Add `error.invalid_token` i18n key to all 9 non-English locale files - Update contract test to include VerificationResponse mapping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,19 @@ func (h *TaskHandler) ListTasks(c echo.Context) error {
|
||||
go h.taskService.UpdateUserTimezone(user.ID, tzHeader)
|
||||
}
|
||||
|
||||
response, err := h.taskService.ListTasks(user.ID, userNow)
|
||||
daysThreshold := 30
|
||||
// Support "days" param first, fall back to "days_threshold" for backward compatibility
|
||||
if d := c.QueryParam("days"); d != "" {
|
||||
if parsed, err := strconv.Atoi(d); err == nil {
|
||||
daysThreshold = parsed
|
||||
}
|
||||
} else if d := c.QueryParam("days_threshold"); d != "" {
|
||||
if parsed, err := strconv.Atoi(d); err == nil {
|
||||
daysThreshold = parsed
|
||||
}
|
||||
}
|
||||
|
||||
response, err := h.taskService.ListTasks(user.ID, daysThreshold, userNow)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user