From ece74390f35aaa369bc6c094e3e83bce89db9c03 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Thu, 27 May 2021 14:58:35 +0200 Subject: [PATCH] Refactor Vendure checkout api handler --- framework/vendure/api/{checkout.ts => checkout/index.ts} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename framework/vendure/api/{checkout.ts => checkout/index.ts} (90%) diff --git a/framework/vendure/api/checkout.ts b/framework/vendure/api/checkout/index.ts similarity index 90% rename from framework/vendure/api/checkout.ts rename to framework/vendure/api/checkout/index.ts index be10ce609..21083e9b7 100644 --- a/framework/vendure/api/checkout.ts +++ b/framework/vendure/api/checkout/index.ts @@ -1,4 +1,3 @@ -import { BigcommerceConfig, getConfig } from '../../bigcommerce/api' import { NextApiHandler } from 'next' const checkoutApi = async (req: any, res: any, config: any) => { @@ -45,7 +44,7 @@ export function createApiHandler( operations, options, }: { - config?: BigcommerceConfig + config?: any operations?: Partial options?: Options extends {} ? Partial : never } = {}): NextApiHandler { @@ -53,7 +52,7 @@ export function createApiHandler( const opts = { ...defaultOptions, ...options } return function apiHandler(req, res) { - return handler(req, res, getConfig(config), ops, opts) + return handler(req, res, config, ops, opts) } } }