mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
Fixed types
This commit is contained in:
@@ -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({
|
||||
|
Reference in New Issue
Block a user