From 8244a6c0bb671a6969f10138be6d04c122ab3f93 Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Fri, 7 Jul 2023 13:18:20 +0200 Subject: [PATCH] Update revalidate paths again --- app/api/revalidate/sanity/route.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/revalidate/sanity/route.ts b/app/api/revalidate/sanity/route.ts index e5c6dd52a..3508fdf22 100644 --- a/app/api/revalidate/sanity/route.ts +++ b/app/api/revalidate/sanity/route.ts @@ -1,4 +1,5 @@ import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook'; +import { i18n } from 'i18n-config'; import { revalidatePath } from 'next/cache'; import { headers } from 'next/headers'; import { NextRequest, NextResponse } from 'next/server'; @@ -31,7 +32,7 @@ export async function POST(request: NextRequest) { let pathToRevalidate = ""; if (type === "home") { - pathToRevalidate = `${locale}` + pathToRevalidate = locale === i18n.defaultLocale ? `${slug}` : `${slug}${locale}` } else { pathToRevalidate = `${locale}${slug}` }