mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 19:51:23 +00:00
Fixed types
This commit is contained in:
@@ -40,7 +40,8 @@ export const handler: MutationHook<Cart, {}, CartItemBody> = {
|
||||
},
|
||||
})
|
||||
|
||||
return checkoutToCart(checkoutLineItemsAdd)
|
||||
// TODO: Fix this Cart type here
|
||||
return checkoutToCart(checkoutLineItemsAdd) as any
|
||||
},
|
||||
useHook: ({ fetch }) => () => {
|
||||
const { mutate } = useCart()
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import { useMemo } from 'react'
|
||||
import type { ShopifyProvider } from '..'
|
||||
|
||||
import useCommerceCart, {
|
||||
FetchCartInput,
|
||||
UseCart,
|
||||
@@ -11,7 +9,7 @@ import { SWRHook } from '@commerce/utils/types'
|
||||
import { checkoutCreate, checkoutToCart } from './utils'
|
||||
import getCheckoutQuery from '../utils/queries/get-checkout-query'
|
||||
|
||||
export default useCommerceCart as UseCart<ShopifyProvider>
|
||||
export default useCommerceCart as UseCart<typeof handler>
|
||||
|
||||
export const handler: SWRHook<
|
||||
Cart | null,
|
||||
@@ -38,7 +36,8 @@ export const handler: SWRHook<
|
||||
checkout = await checkoutCreate(fetch)
|
||||
}
|
||||
|
||||
return checkoutToCart({ checkout })
|
||||
// TODO: Fix this type
|
||||
return checkoutToCart({ checkout } as any)
|
||||
},
|
||||
useHook: ({ useData }) => (input) => {
|
||||
const response = useData({
|
||||
|
@@ -24,7 +24,8 @@ const fetcher: HookFetcherFn<Cart | null, FetchCartInput> = async ({
|
||||
checkout = await checkoutCreate(fetch)
|
||||
}
|
||||
|
||||
return checkoutToCart({ checkout })
|
||||
// TODO: Fix this type
|
||||
return checkoutToCart({ checkout } as any)
|
||||
}
|
||||
|
||||
export default fetcher
|
||||
|
Reference in New Issue
Block a user