mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
handle empty cart, variants, options, errors
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { Product } from '@commerce/types'
|
||||
import { getConfig, SwellConfig } from '../api'
|
||||
import fetchAllProducts from '../api/utils/fetch-all-products'
|
||||
import { ProductEdge } from '../schema'
|
||||
|
||||
type ProductPath = {
|
||||
path: string
|
||||
@@ -20,7 +18,7 @@ const getAllProductPaths = async (options?: {
|
||||
config?: SwellConfig
|
||||
preview?: boolean
|
||||
}): Promise<ReturnType> => {
|
||||
let { config, variables = { limit: 100 } } = options ?? {}
|
||||
let { config, variables = [{ limit: 100 }] } = options ?? {}
|
||||
config = getConfig(config)
|
||||
|
||||
const products = await fetchAllProducts({
|
||||
|
Reference in New Issue
Block a user