mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
Update revalidate paths again
This commit is contained in:
parent
8244a6c0bb
commit
218abc1d10
@ -1,5 +1,4 @@
|
|||||||
import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook';
|
import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook';
|
||||||
import { i18n } from 'i18n-config';
|
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { headers } from 'next/headers';
|
import { headers } from 'next/headers';
|
||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
@ -32,7 +31,7 @@ export async function POST(request: NextRequest) {
|
|||||||
let pathToRevalidate = "";
|
let pathToRevalidate = "";
|
||||||
|
|
||||||
if (type === "home") {
|
if (type === "home") {
|
||||||
pathToRevalidate = locale === i18n.defaultLocale ? `${slug}` : `${slug}${locale}`
|
pathToRevalidate = `${slug}${locale}`
|
||||||
} else {
|
} else {
|
||||||
pathToRevalidate = `${locale}${slug}`
|
pathToRevalidate = `${locale}${slug}`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user