Fix build errors

This commit is contained in:
cond0r
2021-05-13 16:10:09 +03:00
parent e7d0f56e85
commit bff94e73ae
22 changed files with 87 additions and 458 deletions

View File

@@ -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 }
}