refactor(#89): Address PR comments

This commit is contained in:
Josh Creek
2026-01-24 17:26:55 +00:00
parent 8141bd624b
commit 86e8d6f5e6
3 changed files with 18 additions and 3 deletions
@@ -18,10 +18,21 @@ export const PUT = async (event: RequestEvent) => {
await event.locals.supabase.auth.setSession(session);
}
const body = (await event.request.json()) as {
let body: {
folderId?: string | null;
path?: string | null;
};
try {
body = (await event.request.json()) as {
folderId?: string | null;
path?: string | null;
};
} catch (err) {
if (err instanceof SyntaxError) {
return new Response('Malformed JSON', { status: 400 });
}
throw err;
}
const patch: Record<string, unknown> = {};
if (body.folderId !== undefined) patch.folderId = body.folderId;