handle empty cart, variants, options, errors

This commit is contained in:
Greg Hoskin
2021-04-30 18:35:19 -05:00
parent b83753f0b9
commit ffbcce2a9e
8 changed files with 33 additions and 75 deletions

View File

@@ -13,7 +13,7 @@ export type Brands = BrandEdge[]
const getVendors = async (config: SwellConfig) => {
const vendors: [string] =
(await config.fetchSwell('attributes', 'get', ['brand'])).values ?? []
(await config.fetchSwell('attributes', 'get', ['brand']))?.values ?? []
return [...new Set(vendors)].map((v) => ({
node: {