mirror of
https://github.com/vercel/commerce.git
synced 2025-07-05 04:31:22 +00:00
Individual pages should be dynamic
This commit is contained in:
parent
b118a59fb2
commit
62179a040c
@ -4,8 +4,6 @@ import Prose from 'components/prose';
|
|||||||
import { getPage } from 'lib/shopify';
|
import { getPage } from 'lib/shopify';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
}: {
|
}: {
|
||||||
|
@ -357,6 +357,7 @@ export async function getMenu(handle: string): Promise<Menu[]> {
|
|||||||
export async function getPage(handle: string): Promise<Page> {
|
export async function getPage(handle: string): Promise<Page> {
|
||||||
const res = await shopifyFetch<ShopifyPageOperation>({
|
const res = await shopifyFetch<ShopifyPageOperation>({
|
||||||
query: getPageQuery,
|
query: getPageQuery,
|
||||||
|
cache: 'no-store',
|
||||||
variables: { handle }
|
variables: { handle }
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -365,7 +366,8 @@ export async function getPage(handle: string): Promise<Page> {
|
|||||||
|
|
||||||
export async function getPages(): Promise<Page[]> {
|
export async function getPages(): Promise<Page[]> {
|
||||||
const res = await shopifyFetch<ShopifyPagesOperation>({
|
const res = await shopifyFetch<ShopifyPagesOperation>({
|
||||||
query: getPagesQuery
|
query: getPagesQuery,
|
||||||
|
cache: 'no-store'
|
||||||
});
|
});
|
||||||
|
|
||||||
return removeEdgesAndNodes(res.body.data.pages);
|
return removeEdgesAndNodes(res.body.data.pages);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user