Adapt providers

This commit is contained in:
goncy
2021-09-15 14:58:56 -03:00
parent c61641d6a4
commit 6b9ec07d86
7 changed files with 14 additions and 14 deletions

View File

@@ -2,13 +2,13 @@ import { GetAPISchema, createEndpoint } from '@commerce/api'
import checkoutEndpoint from '@commerce/api/endpoints/checkout'
import type { CheckoutSchema } from '../../../types/checkout'
import type { BigcommerceAPI } from '../..'
import checkout from './checkout'
import submitCheckout from './submit-checkout'
export type CheckoutAPI = GetAPISchema<BigcommerceAPI, CheckoutSchema>
export type CheckoutEndpoint = CheckoutAPI['endpoint']
export const handlers: CheckoutEndpoint['handlers'] = { checkout }
export const handlers: CheckoutEndpoint['handlers'] = { submitCheckout }
const checkoutApi = createEndpoint<CheckoutAPI>({
handler: checkoutEndpoint,

View File

@@ -5,7 +5,7 @@ import { uuid } from 'uuidv4'
const fullCheckout = true
const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({
const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({
req,
res,
config,
@@ -87,4 +87,4 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({
res.end()
}
export default checkout
export default submitCheckout