mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
Update revalidate paths again
This commit is contained in:
parent
9f23f9aadc
commit
554068a425
@ -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';
|
||||
@ -26,7 +27,8 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
const slug = requestData.slug;
|
||||
const pathToRevalidate = slug
|
||||
const locale = requestData.locale;
|
||||
const pathToRevalidate = i18n.defaultLocale === locale ? slug : `/${locale}${slug}`;
|
||||
|
||||
revalidatePath(pathToRevalidate);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user