diff --git a/lib/actions/index.ts b/lib/actions/index.ts index ebbff9e..17f62ca 100644 --- a/lib/actions/index.ts +++ b/lib/actions/index.ts @@ -1,6 +1,6 @@ "use server"; -// import { revalidatePath } from "next/cache"; +import { revalidatePath } from "next/cache"; import Product from "../models/product.model"; import { connectToDB } from "../mongoose"; import { scrapeAmazonProduct } from "../scraper"; @@ -44,7 +44,7 @@ export async function scrapeAndStoreProduct(productUrl: string) { { upsert: true, new: true } ); - // revalidatePath(`/products/${newProduct._id}`); + revalidatePath(`/products/${newProduct._id}`); } catch (error: any) { throw new Error(`Failed to create/update product: ${error.message}`); }