feat(ST-513): accept optional metadata in story log and switch validation errors to 422

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-26 21:58:49 +02:00
parent bec0f4adc8
commit 2ce47ce68e
4 changed files with 15 additions and 6 deletions

View file

@ -27,11 +27,11 @@ export async function POST(request: Request) {
}
if (!ALLOWED_TYPES.has(file.type)) {
return Response.json({ error: 'Alleen JPEG, PNG en WebP zijn toegestaan' }, { status: 400 })
return Response.json({ error: 'Alleen JPEG, PNG en WebP zijn toegestaan' }, { status: 422 })
}
if (file.size > MAX_BYTES) {
return Response.json({ error: 'Bestand is groter dan 12 MB' }, { status: 400 })
return Response.json({ error: 'Bestand is groter dan 12 MB' }, { status: 422 })
}
const input = Buffer.from(await file.arrayBuffer())