diff --git a/src/routes/(app)/survey/[surveyId]/+server.ts b/src/routes/(app)/survey/[surveyId]/+server.ts index 9da4182..747761a 100644 --- a/src/routes/(app)/survey/[surveyId]/+server.ts +++ b/src/routes/(app)/survey/[surveyId]/+server.ts @@ -4,7 +4,11 @@ import { surveysTable } from "../../../../db/schema"; import { eq } from "drizzle-orm"; -export const DELETE: RequestHandler = async ({ params }) => { +export const DELETE: RequestHandler = async ({ params, locals }) => { + if (!locals.userId) { + return new Response(null, { status: 403 }); + } + const surveyId = parseInt(params.surveyId ?? ''); if (isNaN(surveyId)) {