mirror of
https://github.com/vercel/commerce.git
synced 2025-03-31 17:25:53 +00:00
Changes
This commit is contained in:
parent
0d4355b431
commit
3ba60fcafc
@ -16,7 +16,7 @@ export interface UseWishlistOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface UseWishlistInput extends UseWishlistOptions {
|
export interface UseWishlistInput extends UseWishlistOptions {
|
||||||
customerId?: Customer['id']
|
customerId?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetcher: HookFetcher<Wishlist | null, UseWishlistInput> = (
|
export const fetcher: HookFetcher<Wishlist | null, UseWishlistInput> = (
|
||||||
|
3
framework/commerce/wishlist/index.ts
Normal file
3
framework/commerce/wishlist/index.ts
Normal file
@ -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'
|
9
framework/types.d.ts
vendored
9
framework/types.d.ts
vendored
@ -36,11 +36,14 @@ interface Wishlist {
|
|||||||
interface Order {}
|
interface Order {}
|
||||||
|
|
||||||
interface Customer {
|
interface Customer {
|
||||||
id: string
|
id: string | number | undefined
|
||||||
name: string
|
[prop: string]: any
|
||||||
email: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UseCustomerResponse = {
|
||||||
|
customer: Customer
|
||||||
|
} | null
|
||||||
|
|
||||||
interface Category {
|
interface Category {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
@ -7,6 +7,7 @@ import { Heart } from '@components/icons'
|
|||||||
import { Text, Container } from '@components/ui'
|
import { Text, Container } from '@components/ui'
|
||||||
import { WishlistCard } from '@components/wishlist'
|
import { WishlistCard } from '@components/wishlist'
|
||||||
import { defatultPageProps } from '@lib/defaults'
|
import { defatultPageProps } from '@lib/defaults'
|
||||||
|
import { useCustomer } from '@framework/customer'
|
||||||
|
|
||||||
export async function getStaticProps({
|
export async function getStaticProps({
|
||||||
preview,
|
preview,
|
||||||
@ -20,7 +21,8 @@ export async function getStaticProps({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Wishlist() {
|
export default function Wishlist() {
|
||||||
const { data, isEmpty } = useWishlist({ includeProducts: true })
|
const { data: customer } = useCustomer()
|
||||||
|
const { data, isEmpty } = useWishlist()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user