mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
26 lines
698 B
TypeScript
26 lines
698 B
TypeScript
import { createEndpoint } from '@commerce/api'
|
|
import type { GetAPISchema, CommerceAPI } from '@commerce/api'
|
|
import checkoutEndpoint from '@commerce/api/endpoints/checkout'
|
|
import type { CheckoutSchema } from '@commerce/types/checkout'
|
|
import getCheckout from './get-checkout'
|
|
import type { SpreeApiProvider } from '../..'
|
|
|
|
export type CheckoutAPI = GetAPISchema<
|
|
CommerceAPI<SpreeApiProvider>,
|
|
CheckoutSchema
|
|
>
|
|
|
|
export type CheckoutEndpoint = CheckoutAPI['endpoint']
|
|
|
|
export const handlers: CheckoutEndpoint['handlers'] = {
|
|
getCheckout,
|
|
submitCheckout: () => {},
|
|
}
|
|
|
|
const checkoutApi = createEndpoint<CheckoutAPI>({
|
|
handler: checkoutEndpoint,
|
|
handlers,
|
|
})
|
|
|
|
export default checkoutApi
|