mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Fix build errors
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import { SwellConfig } from '..'
|
||||
import { SwellProduct } from '../../types'
|
||||
|
||||
const fetchAllProducts = async ({
|
||||
config,
|
||||
query,
|
||||
method,
|
||||
variables,
|
||||
acc = [],
|
||||
}: {
|
||||
config: SwellConfig
|
||||
query: string
|
||||
method: string
|
||||
acc?: SwellProduct[]
|
||||
variables?: any
|
||||
cursor?: string
|
||||
}): Promise<SwellProduct[]> => {
|
||||
const response = await config.fetchSwell(query, method, variables)
|
||||
|
||||
acc = acc.concat(response.results)
|
||||
|
||||
return acc
|
||||
}
|
||||
|
||||
export default fetchAllProducts
|
@@ -1,11 +1,7 @@
|
||||
import { swellConfig } from '../..'
|
||||
|
||||
const fetchSwellApi = async (
|
||||
query: string,
|
||||
method: string,
|
||||
variables: [] = []
|
||||
) => {
|
||||
const fetchApi = async (query: string, method: string, variables: [] = []) => {
|
||||
const { swell } = swellConfig
|
||||
return await swell[query][method](...variables)
|
||||
return swell[query][method](...variables)
|
||||
}
|
||||
export default fetchSwellApi
|
||||
export default fetchApi
|
||||
|
Reference in New Issue
Block a user