diff --git a/framework/commerce/api/operations.ts b/framework/commerce/api/operations.ts index 3cc030f4f..923cf55c6 100644 --- a/framework/commerce/api/operations.ts +++ b/framework/commerce/api/operations.ts @@ -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') diff --git a/pages/[...pages].tsx b/pages/[...pages].tsx index 67adb6287..de9bc90aa 100644 --- a/pages/[...pages].tsx +++ b/pages/[...pages].tsx @@ -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)