From 61fa423673d3a22f15e713809fc18eb263b365f0 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Tue, 26 Jan 2021 17:10:33 -0500 Subject: [PATCH] updated useCart types --- framework/commerce/cart/use-cart.tsx | 4 ++-- framework/commerce/types.d.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/commerce/cart/use-cart.tsx b/framework/commerce/cart/use-cart.tsx index 223767b6f..ecc537539 100644 --- a/framework/commerce/cart/use-cart.tsx +++ b/framework/commerce/cart/use-cart.tsx @@ -6,10 +6,10 @@ import { useCommerce } from '..' export type CartResponse = ResponseState & { isEmpty?: boolean } export type CartInput = { - cartId: Cart['id'] + cartId?: BaseCart['id'] } -export default function useCart( +export default function useCart( options: HookFetcherOptions, input: HookInput, fetcherFn: HookFetcher, diff --git a/framework/commerce/types.d.ts b/framework/commerce/types.d.ts index e5b1ed7c1..eb178619d 100644 --- a/framework/commerce/types.d.ts +++ b/framework/commerce/types.d.ts @@ -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