forked from crowetic/commerce
Merge branch 'master' into arzafran/responsive-bottom-grid
This commit is contained in:
commit
90eaae14d5
@ -27,7 +27,7 @@ export const fetcher: HookFetcher<Wishlist | null, RemoveItemBody> = (
|
|||||||
|
|
||||||
export function extendHook(customFetcher: typeof fetcher) {
|
export function extendHook(customFetcher: typeof fetcher) {
|
||||||
const useRemoveItem = (wishlistId: string, item?: any) => {
|
const useRemoveItem = (wishlistId: string, item?: any) => {
|
||||||
const { mutate } = useWishlist(wishlistId)
|
const { mutate } = useWishlist()
|
||||||
const fn = useAction<Wishlist | null, RemoveItemBody>(
|
const fn = useAction<Wishlist | null, RemoveItemBody>(
|
||||||
defaultOpts,
|
defaultOpts,
|
||||||
customFetcher
|
customFetcher
|
||||||
|
@ -3,9 +3,9 @@ import useRemoveItem from './use-remove-item'
|
|||||||
|
|
||||||
// This hook is probably not going to be used, but it's here
|
// This hook is probably not going to be used, but it's here
|
||||||
// to show how a commerce should be structuring it
|
// to show how a commerce should be structuring it
|
||||||
export default function useWishlistActions(wishlistId: string) {
|
export default function useWishlistActions() {
|
||||||
const addItem = useAddItem(wishlistId)
|
const addItem = useAddItem()
|
||||||
const removeItem = useRemoveItem(wishlistId)
|
const removeItem = useRemoveItem('')
|
||||||
|
|
||||||
return { addItem, removeItem }
|
return { addItem, removeItem }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user