SvelteKit Updated, Uppy broken

This commit is contained in:
Mawoka
2025-09-21 10:48:07 +02:00
parent a87f59f5c0
commit fa533257b3
20 changed files with 1017 additions and 810 deletions
+2 -2
View File
@@ -9,11 +9,11 @@ import type { Data } from '$lib/quiztivity/types';
export const load = (async ({ url, fetch }) => {
const id = url.searchParams.get('id');
if (!id) {
throw error(400, 'id missing');
error(400, 'id missing');
}
const resp = await fetch(`/api/v1/quiztivity/${id}`);
if (!resp.ok) {
throw error(404, 'quiztivity not found');
error(404, 'quiztivity not found');
}
const data: Data = await resp.json();
return {
+2 -2
View File
@@ -10,7 +10,7 @@ export const load = (async ({ url, fetch }) => {
const id = url.searchParams.get('id');
const share = url.searchParams.get('share') === 'true';
if (!id) {
throw error(400, 'id missing');
error(400, 'id missing');
}
let resp: Response;
if (share) {
@@ -19,7 +19,7 @@ export const load = (async ({ url, fetch }) => {
resp = await fetch(`/api/v1/quiztivity/${id}`);
}
if (!resp.ok) {
throw error(resp.status);
error(resp.status);
}
const data: Data = await resp.json();
return {
@@ -8,5 +8,5 @@ import type { PageServerLoad } from './$types';
export const load = (({ params }) => {
const quiz_id = params.share_id;
throw redirect(301, `/quiztivity/play?id=${quiz_id}&share=true`);
redirect(301, `/quiztivity/play?id=${quiz_id}&share=true`);
}) satisfies PageServerLoad;