mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
updated useCart types
This commit is contained in:
parent
7edd5aa182
commit
61fa423673
@ -6,10 +6,10 @@ import { useCommerce } from '..'
|
||||
export type CartResponse<Data> = ResponseState<Data> & { isEmpty?: boolean }
|
||||
|
||||
export type CartInput = {
|
||||
cartId: Cart['id']
|
||||
cartId?: BaseCart['id']
|
||||
}
|
||||
|
||||
export default function useCart<Data>(
|
||||
export default function useCart<Data extends BaseCart | null>(
|
||||
options: HookFetcherOptions,
|
||||
input: HookInput,
|
||||
fetcherFn: HookFetcher<Data, CartInput>,
|
||||
|
3
framework/commerce/types.d.ts
vendored
3
framework/commerce/types.d.ts
vendored
@ -127,7 +127,8 @@ interface BaseCart {
|
||||
discounts?: DiscountBase[]
|
||||
}
|
||||
|
||||
interface Cart extends Entity {
|
||||
// TODO: Remove this type in favor of BaseCart
|
||||
interface Cart2 extends Entity {
|
||||
id: string | undefined
|
||||
currency: { code: string }
|
||||
taxIncluded?: boolean
|
||||
|
Loading…
x
Reference in New Issue
Block a user