mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
fix: Import data
This commit is contained in:
parent
93d5fc0220
commit
703446013b
@ -1,6 +1,6 @@
|
|||||||
import { HookFetcher } from '@commerce/utils/types'
|
import { HookFetcher } from '@commerce/utils/types'
|
||||||
import type { Product } from '@commerce/types/product'
|
import type { Product } from '@commerce/types/product'
|
||||||
import { products } from '../data.json'
|
import data from '../data.json'
|
||||||
import { useCustomer } from '@framework/customer'
|
import { useCustomer } from '@framework/customer'
|
||||||
|
|
||||||
const defaultOpts = {}
|
const defaultOpts = {}
|
||||||
@ -40,7 +40,7 @@ export function extendHook(
|
|||||||
if (getWishlist && customer?.email) {
|
if (getWishlist && customer?.email) {
|
||||||
const wishlist = JSON.parse(getWishlist)
|
const wishlist = JSON.parse(getWishlist)
|
||||||
const items = wishlist.map((wishlist: string) => {
|
const items = wishlist.map((wishlist: string) => {
|
||||||
const [product] = products.filter((p) => p.id === wishlist) as any
|
const [product] = data.products.filter((p) => p.id === wishlist) as any
|
||||||
return {
|
return {
|
||||||
variant_id: wishlist,
|
variant_id: wishlist,
|
||||||
product_id: wishlist,
|
product_id: wishlist,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user