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:
parent
bec0f4adc8
commit
2ce47ce68e
4 changed files with 15 additions and 6 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue