feat: daily puzzle #11

Merged
glazk0 merged 4 commits from dev into main 2023-10-01 00:45:50 +02:00
Showing only changes of commit fc3c885274 - Show all commits

View file

@ -30,8 +30,6 @@ export const load = (async ({ parent, fetch, cookies, params: { chapterId, puzzl
throw redirect(303, `/dashboard/chapters`); throw redirect(303, `/dashboard/chapters`);
} }
console.log(chapter);
if ( if (
!chapter.puzzles.some((puzzle) => puzzle.id === parseInt(puzzleId)) || !chapter.puzzles.some((puzzle) => puzzle.id === parseInt(puzzleId)) ||
!chapter.puzzles.find((puzzle) => puzzle.id === parseInt(puzzleId))?.show !chapter.puzzles.find((puzzle) => puzzle.id === parseInt(puzzleId))?.show
@ -51,8 +49,6 @@ export const load = (async ({ parent, fetch, cookies, params: { chapterId, puzzl
const puzzle = await res.json(); const puzzle = await res.json();
console.log(puzzle);
if (!puzzle) { if (!puzzle) {
throw error(404, 'Puzzle not found'); throw error(404, 'Puzzle not found');
} }
@ -65,7 +61,7 @@ export const load = (async ({ parent, fetch, cookies, params: { chapterId, puzzl
}) satisfies PageServerLoad; }) satisfies PageServerLoad;
export const actions = { export const actions = {
default: async ({ params, request, cookies }) => { default: async ({ params }) => {
throw redirect(303, `/dashboard/chapters/${params.chapterId}/puzzle/${params.puzzleId}`); throw redirect(303, `/dashboard/chapters/${params.chapterId}/puzzle/${params.puzzleId}`);
} }
} satisfies Actions; } satisfies Actions;