import { error } from '@sveltejs/kit'; import { getAllPostersFromDB } from '$lib/db/utils'; /** @type {import('./$types').PageServerLoad} */ export const load = async () => { const posters = getAllPostersFromDB(); if (posters !== undefined) { return { posters: posters } } throw error(404, "error"); }; // /** @type {import('./$types').Actions} */ // export const actions = { // add: async ({ request, locals }) => { // const form = await request.formData(); // await api('POST', `todos/${locals.userid}`, { // text: form.get('text') // }); // }, // edit: async ({ request, locals }) => { // const form = await request.formData(); // await api('PATCH', `todos/${locals.userid}/${form.get('uid')}`, { // text: form.get('text') // }); // }, // toggle: async ({ request, locals }) => { // const form = await request.formData(); // await api('PATCH', `todos/${locals.userid}/${form.get('uid')}`, { // done: !!form.get('done') // }); // }, // delete: async ({ request, locals }) => { // const form = await request.formData(); // await api('DELETE', `todos/${locals.userid}/${form.get('uid')}`); // } // };