periodic commit

This commit is contained in:
NeilClack
2026-02-20 10:25:55 -06:00
parent 664b6daa7f
commit 3ea3ccb2ad
3 changed files with 43 additions and 26 deletions
+15
View File
@@ -0,0 +1,15 @@
import { error } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { prisma } from '$lib/db';
export const GET: RequestHandler = async () => {
const affirmations = await prisma.affirmation.findMany();
if (!affirmations) {
throw error(500, 'unable to fetch affirmations');
}
return new Response(
JSON.stringify({
affirmations
})
);
};