Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

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

Hampus7a42291bafc4
diff --git a/fluxer_api/src/api/admin/controllers/ReportAdminController.ts b/fluxer_api/src/api/admin/controllers/ReportAdminController.ts
index b47b36a46..ffe71ec23 100644
--- a/fluxer_api/src/api/admin/controllers/ReportAdminController.ts
+++ b/fluxer_api/src/api/admin/controllers/ReportAdminController.ts
@@ -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),
);