Update types

This commit is contained in:
goncy
2021-09-15 14:59:09 -03:00
parent 6b9ec07d86
commit 0b421392f7
3 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -45,7 +45,7 @@ export type SubmitCheckoutHandler<T extends CheckoutTypes = CheckoutTypes> =
}
export type CheckoutHandlers<T extends CheckoutTypes = CheckoutTypes> = {
getCheckout: GetCheckoutHandler<T>
getCheckout?: GetCheckoutHandler<T>
submitCheckout: SubmitCheckoutHandler<T>
}

View File

@@ -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