mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(api): search all reports when no status filter is given (#2540)
This commit is contained in:
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),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user