mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
refactor
This commit is contained in:
@@ -2,7 +2,7 @@ import { FetcherError } from '@lib/commerce/utils/errors'
|
||||
import type { GraphQLFetcher } from '@lib/commerce/api'
|
||||
import { getConfig } from '..'
|
||||
import log from '@lib/logger'
|
||||
import fetch from '@lib/fetch'
|
||||
import fetch from './fetch'
|
||||
|
||||
const fetchGraphqlApi: GraphQLFetcher = async (
|
||||
query: string,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { getConfig } from '..'
|
||||
import { BigcommerceApiError, BigcommerceNetworkError } from './errors'
|
||||
import fetch from '@lib/fetch'
|
||||
import fetch from './fetch'
|
||||
|
||||
export default async function fetchStoreApi<T>(
|
||||
endpoint: string,
|
||||
|
3
lib/bigcommerce/api/utils/fetch.ts
Normal file
3
lib/bigcommerce/api/utils/fetch.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import zeitFetch from '@zeit/fetch'
|
||||
|
||||
export default zeitFetch()
|
@@ -1,3 +0,0 @@
|
||||
import zeitFetch from '@zeit/fetch'
|
||||
|
||||
export default typeof window === 'undefined' ? zeitFetch() : fetch
|
Reference in New Issue
Block a user