diff --git a/lib/actions/index.ts b/lib/actions/index.ts new file mode 100644 index 0000000..31f843e --- /dev/null +++ b/lib/actions/index.ts @@ -0,0 +1,12 @@ +'use server' + +import { scrapeAmazonProduct } from "../scraper"; + +export async function scrapeAndStoreProduct(productUrl: string) { + if(!productUrl) return; + try { + const scrapedProudct = await scrapeAmazonProduct(productUrl) + } catch (error: any) { + throw new Error(`Failed to create/update product; ${error.message}`) + } +} \ No newline at end of file