From 1a8fb26d9b387d4503790e90595e0a8d44766853 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sun, 8 Mar 2026 23:10:14 +1300 Subject: [PATCH] Fixed a crash if unexpected key was passed --- materialious/src/routes/api/user/keyValue/[key]/+server.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/materialious/src/routes/api/user/keyValue/[key]/+server.ts b/materialious/src/routes/api/user/keyValue/[key]/+server.ts index 3208b5fd..271db0c1 100644 --- a/materialious/src/routes/api/user/keyValue/[key]/+server.ts +++ b/materialious/src/routes/api/user/keyValue/[key]/+server.ts @@ -3,7 +3,7 @@ import { getUser } from '$lib/server/user'; import { error, json } from '@sveltejs/kit'; import z from 'zod'; -async function keyAllowed(key: string) { +function keyAllowed(key: string) { if (!persistedStoreKeys.includes(key)) throw error(400); } @@ -19,7 +19,6 @@ export async function DELETE({ locals, params }) { keyAllowed(params.key); const user = await getUser(locals.userId); - await user.deleteKeyValue(params.key); return new Response();