feat: add public product detail web flow

This commit is contained in:
2026-09-08 19:56:44 -04:00
parent 7e5ca1448f
commit 5916ce1ff5
6 changed files with 74 additions and 0 deletions
+11
View File
@@ -19,6 +19,17 @@ export async function getPublicListing(id) {
throw new Error(response.status === 404 ? 'Listing not found.' : 'Listing is unavailable.');
}
const payload = await response.json();
return payload.data;
}
export async function getPublicProduct(slug) {
const response = await fetch(`${apiBaseUrl}/public/products/${encodeURIComponent(slug)}`);
if (!response.ok) {
throw new Error(response.status === 404 ? 'Product not found.' : 'Product is unavailable.');
}
const payload = await response.json();
return payload.data;
}