mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +00:00
Changed import
This commit is contained in:
parent
012f4b052f
commit
35c5b1b4a3
@ -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')
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user