From eed1b6b5e7482beaac9f3e0edd792a006e39bc5b Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Tue, 16 May 2023 14:46:23 +0200 Subject: [PATCH] Test revalidate route --- app/api/revalidate/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/revalidate/route.ts b/app/api/revalidate/route.ts index 7e331d5d9..cd84e00ba 100644 --- a/app/api/revalidate/route.ts +++ b/app/api/revalidate/route.ts @@ -2,10 +2,12 @@ import { revalidatePath } from 'next/cache'; import { NextRequest, NextResponse } from 'next/server'; export async function GET(request: NextRequest) { - const path = request.nextUrl.searchParams.get('path') || '/'; + const { searchParams } = new URL(request.url); + const slug = searchParams.get('slug'); + const locale = searchParams.get('locale'); console.log(request.nextUrl.searchParams) - revalidatePath(path); + revalidatePath(`/${locale}/${slug}`); return NextResponse.json({ revalidated: true, now: Date.now() }); } \ No newline at end of file