You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB
JavaScript

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')}`);
// }
// };