From 0b421392f7b0bca5cbcd513b498d4918a391828f Mon Sep 17 00:00:00 2001 From: goncy Date: Wed, 15 Sep 2021 14:59:09 -0300 Subject: [PATCH] Update types --- framework/commerce/api/endpoints/checkout.ts | 2 +- framework/commerce/types/checkout.ts | 2 +- framework/commerce/types/customer/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/commerce/api/endpoints/checkout.ts b/framework/commerce/api/endpoints/checkout.ts index 09ebff621..b00bce284 100644 --- a/framework/commerce/api/endpoints/checkout.ts +++ b/framework/commerce/api/endpoints/checkout.ts @@ -26,7 +26,7 @@ const checkoutEndpoint: GetAPISchema< // Create checkout if (req.method === 'GET') { const body = { ...req.body, cartId } - return await handlers['getCheckout']({ ...ctx, body }) + return await handlers['getCheckout']?.({ ...ctx, body }) } // Create checkout diff --git a/framework/commerce/types/checkout.ts b/framework/commerce/types/checkout.ts index 27f553207..ea28926a8 100644 --- a/framework/commerce/types/checkout.ts +++ b/framework/commerce/types/checkout.ts @@ -45,7 +45,7 @@ export type SubmitCheckoutHandler = } export type CheckoutHandlers = { - getCheckout: GetCheckoutHandler + getCheckout?: GetCheckoutHandler submitCheckout: SubmitCheckoutHandler } diff --git a/framework/commerce/types/customer/index.ts b/framework/commerce/types/customer/index.ts index 7a99d8c5e..70c437c29 100644 --- a/framework/commerce/types/customer/index.ts +++ b/framework/commerce/types/customer/index.ts @@ -2,7 +2,7 @@ export * as Card from "./card" export * as Address from "./address" // TODO: define this type -export type Customer = unknown +export type Customer = any export type CustomerTypes = { customer: Customer