Add API routes

This commit is contained in:
NeilClack
2026-03-25 17:26:09 -05:00
parent 7d211ba6d8
commit e563a66dc7
12 changed files with 1646 additions and 13 deletions
+7
View File
@@ -0,0 +1,7 @@
import type { RequestHandler } from './$types';
import { prisma } from '$lib/db';
export const GET: RequestHandler = async () => {
const categories = await prisma.proclamationCategory.findMany()
return new Response(JSON.stringify(categories))
}
+1 -5
View File
@@ -17,11 +17,7 @@ export const GET: RequestHandler = async ({ url }) => {
throw error(500, 'unable to fetch proclamations');
}
return new Response(
JSON.stringify({
proclamations
})
);
return new Response(JSON.stringify(proclamations));
}
// Check that the key exists