Update revalidate function

This commit is contained in:
Henrik Larsson
2023-08-25 08:52:59 +02:00
parent 20caffdce3
commit 93ba85fbf5
2 changed files with 4 additions and 4 deletions

View File

@@ -43,12 +43,12 @@ export async function POST(req: NextRequest) {
return new Response('Bad Request', { status: 400 })
}
console.log(body)
revalidateTag(body._type)
if (body.slug) {
revalidateTag(`${body._type}:${body.slug}`)
} else {
revalidateTag(`${body._type}`)
}
return NextResponse.json({