mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
Merge pull request #18 from zenzen-sol/sol/2023-11-12-merge-test
fix: Issue with shoplist
This commit is contained in:
commit
84a8a087db
@ -1,8 +1,16 @@
|
||||
import { SupportedLocale } from 'components/layout/navbar/language-control';
|
||||
import OpengraphImage from 'components/opengraph-image';
|
||||
import { getPage } from 'lib/shopify';
|
||||
|
||||
export default async function Image({ params }: { params: { page: string } }) {
|
||||
const page = await getPage({ handle: params.page });
|
||||
export default async function Image({
|
||||
params
|
||||
}: {
|
||||
params: { page: string; locale?: SupportedLocale };
|
||||
}) {
|
||||
const page = await getPage({
|
||||
handle: params.page,
|
||||
language: params?.locale?.toUpperCase() || 'JA'
|
||||
});
|
||||
const title = page.seo?.title || page.title;
|
||||
|
||||
return await OpengraphImage({ title });
|
||||
|
@ -5,6 +5,7 @@ import Navbar from 'components/layout/navbar';
|
||||
import { SupportedLocale } from 'components/layout/navbar/language-control';
|
||||
import { getCart, getPage, getProduct } from 'lib/shopify';
|
||||
import { Product } from 'lib/shopify/types';
|
||||
import { unstable_noStore } from 'next/cache';
|
||||
import { cookies } from 'next/headers';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { Suspense } from 'react';
|
||||
@ -16,6 +17,7 @@ export async function generateMetadata({
|
||||
}: {
|
||||
params: { locale?: SupportedLocale };
|
||||
}): Promise<Metadata> {
|
||||
unstable_noStore(); // opt out before we even get to the try/catch
|
||||
const page = await getPage({
|
||||
handle: 'shop-list',
|
||||
language: params?.locale?.toUpperCase() || 'JA'
|
||||
|
@ -400,7 +400,7 @@ export async function getPage({
|
||||
}): Promise<Page> {
|
||||
const res = await shopifyFetch<ShopifyPageOperation>({
|
||||
query: getPageQuery,
|
||||
// cache: 'no-store',
|
||||
cache: 'no-store',
|
||||
variables: { handle, language, country }
|
||||
});
|
||||
|
||||
@ -416,7 +416,7 @@ export async function getPages({
|
||||
}): Promise<Page[]> {
|
||||
const res = await shopifyFetch<ShopifyPagesOperation>({
|
||||
query: getPagesQuery,
|
||||
// cache: 'no-store',
|
||||
cache: 'no-store',
|
||||
variables: { language, country }
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user