Moved getSiteInfo

This commit is contained in:
Luis Alvarez
2021-05-21 18:49:11 -05:00
parent 74a93b4900
commit f2c79d07a7
8 changed files with 145 additions and 112 deletions

View File

@@ -7,7 +7,6 @@ import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
import { getConfig } from '@framework/api'
import getAllProducts from '@framework/product/get-all-products'
import getSiteInfo from '@framework/common/get-site-info'
export async function getStaticProps({
preview,
@@ -21,7 +20,7 @@ export async function getStaticProps({
preview,
})
const { categories, brands } = await getSiteInfo({ config, preview })
const { categories, brands } = await commerce.getSiteInfo({ config, preview })
const { pages } = await commerce.getAllPages({ config, preview })
return {

View File

@@ -10,7 +10,6 @@ import { Container, Grid, Skeleton } from '@components/ui'
import { getConfig } from '@framework/api'
import useSearch from '@framework/product/use-search'
import getSiteInfo from '@framework/common/get-site-info'
import commerce from '@lib/api/commerce'
import rangeMap from '@lib/range-map'
@@ -39,7 +38,7 @@ export async function getStaticProps({
}: GetStaticPropsContext) {
const config = getConfig({ locale })
const { pages } = await commerce.getAllPages({ config, preview })
const { categories, brands } = await getSiteInfo({ config, preview })
const { categories, brands } = await commerce.getSiteInfo({ config, preview })
return {
props: {
pages,