periodic commit
This commit is contained in:
@@ -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
|
||||
})
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user