feat: functional folders (filter/delete/gallery) + always show model + variant switcher
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
This commit is contained in:
@@ -20,3 +20,13 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
[b.name.trim(), b.picdrop_gallery || null]);
|
||||
return json({ folder: row });
|
||||
};
|
||||
|
||||
// Ordner löschen (Bilder bleiben, verlieren nur die Zuordnung). ?id=…
|
||||
export const DELETE: APIRoute = async ({ request, url, locals }) => {
|
||||
if (!locals.user) return new Response('Unauthorized', { status: 401 });
|
||||
let id = url.searchParams.get('id');
|
||||
if (!id) { try { id = (await request.json())?.id; } catch { /* egal */ } }
|
||||
if (!id) return json({ error: 'Keine ID.' }, 400);
|
||||
await query('DELETE FROM folders WHERE id=$1', [id]);
|
||||
return json({ ok: true });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user