mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Add blocking fallback to pages (#357)
* Update [...pages].tsx * Fix provider config overwrite * Shopify changes
This commit is contained in:
@@ -50,18 +50,18 @@ export const handler: SWRHook<SearchProductsHook> = {
|
||||
})
|
||||
// filter on client when brandId & categoryId are set since is not available on collection product query
|
||||
products = brandId
|
||||
? data.node.products.edges.filter(
|
||||
? data.node?.products?.edges?.filter(
|
||||
({ node: { vendor } }: ProductEdge) =>
|
||||
vendor.replace(/\s+/g, '-').toLowerCase() === brandId
|
||||
)
|
||||
: data.node.products.edges
|
||||
: data.node?.products?.edges
|
||||
} else {
|
||||
const data = await fetch<GetAllProductsQuery>({
|
||||
query: options.query,
|
||||
method,
|
||||
variables,
|
||||
})
|
||||
products = data.products.edges
|
||||
products = data.products?.edges
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user