fix: ST-609 demo-check toegevoegd aan POST /api/stories/:id/log en POST /api/todos
This commit is contained in:
parent
d26d58f664
commit
088d318e51
2 changed files with 6 additions and 0 deletions
|
|
@ -28,6 +28,9 @@ export async function POST(
|
||||||
if ('error' in auth) {
|
if ('error' in auth) {
|
||||||
return Response.json({ error: auth.error }, { status: auth.status })
|
return Response.json({ error: auth.error }, { status: auth.status })
|
||||||
}
|
}
|
||||||
|
if (auth.isDemo) {
|
||||||
|
return Response.json({ error: 'Niet beschikbaar in demo-modus' }, { status: 403 })
|
||||||
|
}
|
||||||
|
|
||||||
const { id: storyId } = await params
|
const { id: storyId } = await params
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ export async function POST(request: Request) {
|
||||||
if ('error' in auth) {
|
if ('error' in auth) {
|
||||||
return Response.json({ error: auth.error }, { status: auth.status })
|
return Response.json({ error: auth.error }, { status: auth.status })
|
||||||
}
|
}
|
||||||
|
if (auth.isDemo) {
|
||||||
|
return Response.json({ error: 'Niet beschikbaar in demo-modus' }, { status: 403 })
|
||||||
|
}
|
||||||
|
|
||||||
const body = await request.json().catch(() => null)
|
const body = await request.json().catch(() => null)
|
||||||
const parsed = bodySchema.safeParse(body)
|
const parsed = bodySchema.safeParse(body)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue