mirror of
https://github.com/vercel/commerce.git
synced 2025-05-20 00:16:59 +00:00
* new SFCC provider * add search * normalization + search * categories as search results * adress PR feedback * Update README.md * get all paths for SSG * product variants and options * Apply suggestions from code review Co-authored-by: Luis Alvarez D. <luis@vercel.com> * remove console log * prettier * clean console log * ran prettier * Updated readme * remove static data and revert config changes * set default site Co-authored-by: Luis Alvarez D. <luis@vercel.com>
44 lines
891 B
TypeScript
44 lines
891 B
TypeScript
import { HookFetcher } from '@vercel/commerce/utils/types'
|
|
import type { Product } from '@vercel/commerce/types/product'
|
|
|
|
const defaultOpts = {}
|
|
|
|
export type Wishlist = {
|
|
items: [
|
|
{
|
|
product_id: number
|
|
variant_id: number
|
|
id: number
|
|
product: Product
|
|
}
|
|
]
|
|
}
|
|
|
|
export interface UseWishlistOptions {
|
|
includeProducts?: boolean
|
|
}
|
|
|
|
export interface UseWishlistInput extends UseWishlistOptions {
|
|
customerId?: number
|
|
}
|
|
|
|
export const fetcher: HookFetcher<Wishlist | null, UseWishlistInput> = () => {
|
|
return null
|
|
}
|
|
|
|
export function extendHook(
|
|
customFetcher: typeof fetcher,
|
|
// swrOptions?: SwrOptions<Wishlist | null, UseWishlistInput>
|
|
swrOptions?: any
|
|
) {
|
|
const useWishlist = ({ includeProducts }: UseWishlistOptions = {}) => {
|
|
return { data: null }
|
|
}
|
|
|
|
useWishlist.extend = extendHook
|
|
|
|
return useWishlist
|
|
}
|
|
|
|
export default extendHook(fetcher)
|