Fix redirect checkout (#502)

* Fix redirect checkout

* Don't use checkout for saleor
This commit is contained in:
Gonzalo Pozzo
2021-09-24 13:42:09 -03:00
committed by GitHub
parent c440ff06d4
commit 8e7b942240
11 changed files with 21 additions and 22 deletions

View File

@@ -6,7 +6,7 @@ import {
import associateCustomerWithCheckoutMutation from '../../../utils/mutations/associate-customer-with-checkout'
import type { CheckoutEndpoint } from '.'
const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({
const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({
req,
res,
config,
@@ -35,4 +35,4 @@ const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({
}
}
export default submitCheckout
export default getCheckout

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 { ShopifyAPI } from '../..'
import submitCheckout from './submit-checkout'
import getCheckout from './get-checkout'
export type CheckoutAPI = GetAPISchema<ShopifyAPI, CheckoutSchema>
export type CheckoutEndpoint = CheckoutAPI['endpoint']
export const handlers: CheckoutEndpoint['handlers'] = { submitCheckout }
export const handlers: CheckoutEndpoint['handlers'] = { getCheckout }
const checkoutApi = createEndpoint<CheckoutAPI>({
handler: checkoutEndpoint,