feat(#46): Componentise the boxes view

This commit is contained in:
Josh Creek
2024-07-17 21:11:58 +01:00
parent e4ca722de7
commit 4d9d5e74d7
5 changed files with 332 additions and 120 deletions
+3 -1
View File
@@ -4,11 +4,13 @@ import CombinedDataRepository from '$lib/repositories/CombinedDataRepository';
export const GET = async ({ url }) => {
const enableForms = url.searchParams.get('enableForms') === 'true';
const region = url.searchParams.get('region');
const game = url.searchParams.get('game');
try {
await dbConnect();
const repo = new CombinedDataRepository();
const combinedData = await repo.findAllCombinedData(enableForms);
const combinedData = await repo.findAllCombinedData(enableForms, region, game);
if (combinedData.length === 0) {
return json({ error: 'No combined data found' }, { status: 404 });