Added entity reporting.

This commit is contained in:
2026-11-13 00:23:13 +01:00
parent 6143c41668
commit 1d219850d7
18 changed files with 840 additions and 5 deletions
+25
View File
@@ -0,0 +1,25 @@
import { render } from 'vike/abort';
import { canReviewReports, fetchReports } from '#/src/reports.js';
export async function onBeforeRender(pageContext) {
if (!canReviewReports(pageContext.user)) {
throw render(404);
}
const completed = pageContext.urlParsed.search.completed === 'true';
const reports = await fetchReports({ completed }, pageContext.user);
return {
pageContext: {
title: 'Reports',
pageProps: {
reports,
completed,
},
routeParams: {
section: 'reports',
},
},
};
}