From b03940bb0bdc151f1d3b15c0ac8e0bf8182582e4 Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Fri, 7 Jul 2023 13:57:24 +0200 Subject: [PATCH] Update revalidate paths again --- app/api/revalidate/sanity/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/revalidate/sanity/route.ts b/app/api/revalidate/sanity/route.ts index 43697f00a..81253fe8b 100644 --- a/app/api/revalidate/sanity/route.ts +++ b/app/api/revalidate/sanity/route.ts @@ -4,7 +4,7 @@ import { headers } from 'next/headers'; import { NextRequest, NextResponse } from 'next/server'; const SANITY_WEBHOOK_SECRET = `${process.env.SANITY_WEBHOOK_SECRET}`; - +export const runtime = 'edge' export async function POST(request: NextRequest) { // Await the response from our request. const requestData = await request.json(); @@ -31,9 +31,9 @@ export async function POST(request: NextRequest) { let pathToRevalidate = ""; if (type === "home") { - pathToRevalidate = `${slug}${locale}` + pathToRevalidate = `${slug}` } else { - pathToRevalidate = `${locale}${slug}` + pathToRevalidate = `/${locale}${slug}` } revalidatePath(pathToRevalidate);