update get-page and get-all-pages content hooks

This commit is contained in:
Greg Hoskin
2021-04-09 16:51:35 -06:00
parent abd86329d5
commit 644f196c97
5 changed files with 18 additions and 24 deletions

View File

@@ -21,9 +21,11 @@ const getAllProducts = async (options: {
}): Promise<ReturnType> => {
let { config, variables = { first: 250 } } = options ?? {}
config = getConfig(config)
const { results } = await config.fetchSwell('products', 'list', {
limit: variables.first,
})
const { results } = await config.fetchSwell('products', 'list', [
{
limit: variables.first,
},
])
const products = results.map((product) => normalizeProduct(product)) ?? []
return {
products,