From 0b298e49805be3b2a08813af5d3f5f38965360d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o?= <43091603+glazk0@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:23:57 +0200 Subject: [PATCH] misc: removed useless stuff --- .../dashboard/chapters/[chapterId]/puzzle/+page.server.ts | 6 +++--- .../chapters/[chapterId]/puzzle/[puzzleId]/+page.server.ts | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) 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 };