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

@ -20,7 +20,7 @@ export async function POST(request: Request) {
const body = await request.json().catch(() => null)
const parsed = bodySchema.safeParse(body)
if (!parsed.success) {
return Response.json({ error: parsed.error.flatten() }, { status: 400 })
return Response.json({ error: parsed.error.flatten() }, { status: 422 })
}
const product = await prisma.product.findFirst({