diff --git a/framework/bigcommerce/wishlist/use-wishlist.tsx b/framework/bigcommerce/wishlist/use-wishlist.tsx index 455fdc9ff..6ebc8459d 100644 --- a/framework/bigcommerce/wishlist/use-wishlist.tsx +++ b/framework/bigcommerce/wishlist/use-wishlist.tsx @@ -16,7 +16,7 @@ export interface UseWishlistOptions { } export interface UseWishlistInput extends UseWishlistOptions { - customerId?: Customer['id'] + customerId?: number } export const fetcher: HookFetcher = ( diff --git a/framework/commerce/wishlist/index.ts b/framework/commerce/wishlist/index.ts new file mode 100644 index 000000000..241af3c7e --- /dev/null +++ b/framework/commerce/wishlist/index.ts @@ -0,0 +1,3 @@ +export { default as useAddItem } from './use-add-item' +export { default as useWishlist } from './use-wishlist' +export { default as useRemoveItem } from './use-remove-item' diff --git a/framework/types.d.ts b/framework/types.d.ts index 881218ca8..8958a9a04 100644 --- a/framework/types.d.ts +++ b/framework/types.d.ts @@ -36,11 +36,14 @@ interface Wishlist { interface Order {} interface Customer { - id: string - name: string - email: string + id: string | number | undefined + [prop: string]: any } +type UseCustomerResponse = { + customer: Customer +} | null + interface Category { id: string name: string diff --git a/pages/wishlist.tsx b/pages/wishlist.tsx index b52c78d47..8f957280f 100644 --- a/pages/wishlist.tsx +++ b/pages/wishlist.tsx @@ -7,6 +7,7 @@ import { Heart } from '@components/icons' import { Text, Container } from '@components/ui' import { WishlistCard } from '@components/wishlist' import { defatultPageProps } from '@lib/defaults' +import { useCustomer } from '@framework/customer' export async function getStaticProps({ preview, @@ -20,7 +21,8 @@ export async function getStaticProps({ } export default function Wishlist() { - const { data, isEmpty } = useWishlist({ includeProducts: true }) + const { data: customer } = useCustomer() + const { data, isEmpty } = useWishlist() return (