export type Product = { id: number; title: string; price_cents: number; image_url: string; }; export async function fetchProducts(): Promise { const res = await fetch("/api/products", { cache: "no-store" }); if (!res.ok) { throw new Error("Failed to fetch products"); } return res.json(); } export async function fetchProduct(productId: string): Promise { const res = await fetch(`/api/products/${productId}`, { cache: "no-store" }); if (!res.ok) { throw new Error("Failed to fetch product"); } return res.json(); }