mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Fix build errors
This commit is contained in:
@@ -23,12 +23,13 @@ const getAllPages = async (options?: {
|
||||
}): Promise<ReturnType> => {
|
||||
let { config, variables = { first: 250 } } = options ?? {}
|
||||
config = getConfig(config)
|
||||
const { locale, fetchSwell } = config
|
||||
const { results } = await fetchSwell('content', 'list', ['pages'])
|
||||
const pages = results.map(({ slug, ...rest }: { slug: string }) => ({
|
||||
url: `/${locale}/${slug}`,
|
||||
...rest,
|
||||
}))
|
||||
const { locale, fetch } = config
|
||||
const data = await fetch('content', 'list', ['pages'])
|
||||
const pages =
|
||||
data?.results?.map(({ slug, ...rest }: { slug: string }) => ({
|
||||
url: `/${locale}/${slug}`,
|
||||
...rest,
|
||||
})) ?? []
|
||||
|
||||
return { pages }
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ const getPage = async (options: {
|
||||
config = getConfig(config)
|
||||
const { locale } = config
|
||||
const { id } = variables
|
||||
const result = await config.fetchSwell('content', 'get', ['pages', id])
|
||||
const result = await config.fetch('content', 'get', ['pages', id])
|
||||
const page = result
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user