fix(api): search all reports when no status filter is given (#2540)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-06 18:39:18 +02:00
1 parent d9f983b08e
commit 7a42291baf
1 file changed
+2 -2
@@ -88,12 +88,12 @@ export function ReportAdminController(app: HonoApp) {
const adminService = ctx.get('adminService');
const adminUserAcls = ctx.get('adminUserAcls');
const query = ctx.req.valid('query');
if (usesReportSearchIndex(query)) {
if (query.status === undefined || usesReportSearchIndex(query)) {
return ctx.json(
await adminService.reportServiceAggregate.searchReports(toSearchReportsRequest(query), adminUserAcls),
);
}
const status = query.status === undefined ? 0 : REPORT_STATUS_BY_FILTER[query.status];
const status = REPORT_STATUS_BY_FILTER[query.status];
return ctx.json(
await adminService.reportServiceAggregate.listReports(status, adminUserAcls, query.limit, query.offset),
);