add report pagination
All checks were successful
delpoy / build-and-deploy (push) Successful in 40s

This commit is contained in:
2024-01-10 23:41:51 +01:00
parent f74f1fe19e
commit 6d9f3c41aa
3 changed files with 29 additions and 10 deletions

View File

@@ -85,7 +85,9 @@ export const POST = (async ({ request, cookies }) => {
return r;
});
return new Response(JSON.stringify(reports));
return new Response(
JSON.stringify({ reports: reports, count: await Report.count({ where: reportFindOptions }) })
);
}) satisfies RequestHandler;
export const PATCH = (async ({ request, cookies }) => {