diff --git a/framework/bigcommerce/provider.tsx b/framework/bigcommerce/fetcher.ts similarity index 64% rename from framework/bigcommerce/provider.tsx rename to framework/bigcommerce/fetcher.ts index a54fab0bb..f8ca0c578 100644 --- a/framework/bigcommerce/provider.tsx +++ b/framework/bigcommerce/fetcher.ts @@ -1,10 +1,5 @@ import { FetcherError } from '@commerce/utils/errors' import type { Fetcher } from '@commerce/utils/types' -import { normalizeCart } from './lib/normalize' -import { handler as useCart } from './cart/use-cart' -import { handler as useWishlist } from './wishlist/use-wishlist' -import { handler as useCustomer } from './customer/use-customer' -import { handler as useSearch } from './product/use-search' async function getText(res: Response) { try { @@ -43,15 +38,4 @@ const fetcher: Fetcher = async ({ throw await getError(res) } -export const bigcommerceProvider = { - locale: 'en-us', - cartCookie: 'bc_cartId', - fetcher, - cartNormalizer: normalizeCart, - cart: { useCart }, - wishlist: { useWishlist }, - customer: { useCustomer }, - products: { useSearch }, -} - -export type BigcommerceProvider = typeof bigcommerceProvider +export default fetcher diff --git a/framework/bigcommerce/provider.ts b/framework/bigcommerce/provider.ts new file mode 100644 index 000000000..ee5630813 --- /dev/null +++ b/framework/bigcommerce/provider.ts @@ -0,0 +1,17 @@ +import { handler as useCart } from './cart/use-cart' +import { handler as useWishlist } from './wishlist/use-wishlist' +import { handler as useCustomer } from './customer/use-customer' +import { handler as useSearch } from './product/use-search' +import fetcher from './fetcher' + +export const bigcommerceProvider = { + locale: 'en-us', + cartCookie: 'bc_cartId', + fetcher, + cart: { useCart }, + wishlist: { useWishlist }, + customer: { useCustomer }, + products: { useSearch }, +} + +export type BigcommerceProvider = typeof bigcommerceProvider