SvelteKit Updated, Uppy broken
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user