From dd3154eff2135a0253db71ca16821cd5b3824659 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Thu, 7 Nov 2024 18:49:04 -0600 Subject: [PATCH] fix --- pages/api/social-image.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/api/social-image.tsx b/pages/api/social-image.tsx index bc8e1de..d8568e4 100644 --- a/pages/api/social-image.tsx +++ b/pages/api/social-image.tsx @@ -6,7 +6,8 @@ import { getBlockIcon, getBlockTitle, getPageProperty, - isUrl + isUrl, + parsePageId } from 'notion-utils' import * as libConfig from '@/lib/config' @@ -23,7 +24,9 @@ export default async function OGImage( res: NextApiResponse ) { const { searchParams } = new URL(req.url) - const pageId = searchParams.get('id') || libConfig.rootNotionPageId + const pageId = parsePageId( + searchParams.get('id') || libConfig.rootNotionPageId + ) if (!pageId) { return new Response('Invalid notion page id', { status: 400 }) }