diff --git a/src/routes/dashboard/chapters/[chapterId]/puzzle/+page.server.ts b/src/routes/dashboard/chapters/[chapterId]/puzzle/+page.server.ts index aa307ab..680126f 100644 --- a/src/routes/dashboard/chapters/[chapterId]/puzzle/+page.server.ts +++ b/src/routes/dashboard/chapters/[chapterId]/puzzle/+page.server.ts @@ -1,8 +1,8 @@ -import { API_URL } from '$env/static/private'; -import { redirect, type Actions } from '@sveltejs/kit'; +import { redirect } from '@sveltejs/kit'; + import type { PageServerLoad } from './$types'; -export const load = (async ({ parent, fetch, cookies, params: { chapterId } }) => { +export const load = (async ({ parent, params: { chapterId } }) => { await parent(); throw redirect(303, chapterId ? `/dashboard/chapters/${chapterId}` : `/dashboard/chapters`); }) satisfies PageServerLoad; diff --git a/src/routes/dashboard/chapters/[chapterId]/puzzle/[puzzleId]/+page.server.ts b/src/routes/dashboard/chapters/[chapterId]/puzzle/[puzzleId]/+page.server.ts index 704b68c..edb0094 100644 --- a/src/routes/dashboard/chapters/[chapterId]/puzzle/[puzzleId]/+page.server.ts +++ b/src/routes/dashboard/chapters/[chapterId]/puzzle/[puzzleId]/+page.server.ts @@ -1,7 +1,8 @@ import { API_URL } from '$env/static/private'; import { error, redirect, type Actions } from '@sveltejs/kit'; -import type Puzzle from '$lib/components/Puzzle.svelte'; import type { PageServerLoad } from './$types'; + +import type Puzzle from '$lib/components/Puzzle.svelte'; import type { Chapter } from '$lib/types'; export const load = (async ({ parent, fetch, cookies, params: { chapterId, puzzleId } }) => { @@ -49,8 +50,6 @@ export const load = (async ({ parent, fetch, cookies, params: { chapterId, puzzl throw error(404, 'Puzzle not found'); } - console.log(puzzle.content); - return { puzzle: puzzle as Puzzle };