mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Update types
This commit is contained in:
@@ -26,7 +26,7 @@ const checkoutEndpoint: GetAPISchema<
|
|||||||
// Create checkout
|
// Create checkout
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
const body = { ...req.body, cartId }
|
const body = { ...req.body, cartId }
|
||||||
return await handlers['getCheckout']({ ...ctx, body })
|
return await handlers['getCheckout']?.({ ...ctx, body })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create checkout
|
// Create checkout
|
||||||
|
@@ -45,7 +45,7 @@ export type SubmitCheckoutHandler<T extends CheckoutTypes = CheckoutTypes> =
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type CheckoutHandlers<T extends CheckoutTypes = CheckoutTypes> = {
|
export type CheckoutHandlers<T extends CheckoutTypes = CheckoutTypes> = {
|
||||||
getCheckout: GetCheckoutHandler<T>
|
getCheckout?: GetCheckoutHandler<T>
|
||||||
submitCheckout: SubmitCheckoutHandler<T>
|
submitCheckout: SubmitCheckoutHandler<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ export * as Card from "./card"
|
|||||||
export * as Address from "./address"
|
export * as Address from "./address"
|
||||||
|
|
||||||
// TODO: define this type
|
// TODO: define this type
|
||||||
export type Customer = unknown
|
export type Customer = any
|
||||||
|
|
||||||
export type CustomerTypes = {
|
export type CustomerTypes = {
|
||||||
customer: Customer
|
customer: Customer
|
||||||
|
Reference in New Issue
Block a user