Fetch single product during build time

This commit is contained in:
tniezg
2021-07-28 14:05:46 +02:00
parent 24e635b048
commit a7a75e7f69
6 changed files with 193 additions and 115 deletions

View File

@@ -6,6 +6,8 @@ export type GetAllProductPathsResult = {
export default function getAllProductPathsOperation() {
function getAllProductPaths(): Promise<GetAllProductPathsResult> {
console.log('getAllProductPaths called.')
return Promise.resolve({
// products: data.products.map(({ path }) => ({ path })),
// TODO: Return Storefront [{ path: '/long-sleeve-shirt' }, ...] from Spree products. Paths using product IDs are fine too.