fix: opengraph image

This commit is contained in:
Victor Gerbrands 2023-08-07 15:56:44 +02:00
parent ae2aecfb11
commit 519b40cf12
2 changed files with 7 additions and 5 deletions

View File

@ -1,11 +1,13 @@
import OpengraphImage from 'components/opengraph-image';
import { getPage } from 'lib/medusa';
// import { getPage } from 'lib/medusa';
export const runtime = 'edge';
export default async function Image({ params }: { params: { page: string } }) {
const page = await getPage(params.page);
const title = page.seo?.title || page.title;
// Medusa doesn't support content pages right now
// const page = await getPage(params.page);
// const title = page.seo?.title || page.title;
const title = process.env.SITE_NAME || 'Medusa Store';
return await OpengraphImage({ title });
}

View File

@ -384,8 +384,8 @@ export async function getCategory(handle: string): Promise<ProductCollection | u
export async function getCategoryProducts(
handle: string,
reverse: boolean,
sortKey: string
reverse?: boolean,
sortKey?: string
): Promise<Product[]> {
const res = await medusaRequest({
method: 'GET',