In the attached image below you can see my folder structure, I want to revalidate the cached images in text-to-image layout.
This is my route handler code.
route.ts
import { revalidatePath } from "next/cache";
import { NextResponse } from "next/server";
export async function GET() {
revalidatePath("/[locale]/(products)/text-to-image", "layout");
console.log("revalidating images");
return NextResponse.json({ revalidated: true, now: Date.now() });
}
Am I missing something?
it works fine if I want to revalidate everything using revalidatePath("/", "layout").