Changed import

This commit is contained in:
Luis Alvarez 2021-05-20 21:04:43 -05:00
parent 012f4b052f
commit 35c5b1b4a3
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import type { LoginOperation } from '../types/login'
import type { GetAllPagesOperation } from '../types/page'
import type { ServerResponse } from 'http'
import type { APIProvider, CommerceAPI, CommerceAPICore } from '.'
import type { APIProvider, CommerceAPI } from '.'
const noop = () => {
throw new Error('Not implemented')

View File

@ -5,11 +5,11 @@ import type {
} from 'next'
import { Text } from '@components/ui'
import { Layout } from '@components/common'
import commerce from '@lib/api/commerce'
import getSlug from '@lib/get-slug'
import { missingLocaleInPages } from '@lib/usage-warns'
import { getConfig } from '@framework/api'
import getPage from '@framework/common/get-page'
import getAllPages from '@framework/common/get-all-pages'
import { defaultPageProps } from '@lib/defaults'
export async function getStaticProps({
@ -18,7 +18,7 @@ export async function getStaticProps({
locale,
}: GetStaticPropsContext<{ pages: string[] }>) {
const config = getConfig({ locale })
const { pages } = await getAllPages({ preview, config })
const { pages } = await commerce.getAllPages({ preview, config })
const path = params?.pages.join('/')
const slug = locale ? `${locale}/${path}` : path
@ -41,7 +41,7 @@ export async function getStaticProps({
}
export async function getStaticPaths({ locales }: GetStaticPathsContext) {
const { pages } = await getAllPages()
const { pages } = await commerce.getAllPages()
const [invalidPaths, log] = missingLocaleInPages()
const paths = pages
.map((page) => page.url)