We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6394b01 commit dd3154eCopy full SHA for dd3154e
pages/api/social-image.tsx
@@ -6,7 +6,8 @@ import {
6
getBlockIcon,
7
getBlockTitle,
8
getPageProperty,
9
- isUrl
+ isUrl,
10
+ parsePageId
11
} from 'notion-utils'
12
13
import * as libConfig from '@/lib/config'
@@ -23,7 +24,9 @@ export default async function OGImage(
23
24
res: NextApiResponse
25
) {
26
const { searchParams } = new URL(req.url)
- const pageId = searchParams.get('id') || libConfig.rootNotionPageId
27
+ const pageId = parsePageId(
28
+ searchParams.get('id') || libConfig.rootNotionPageId
29
+ )
30
if (!pageId) {
31
return new Response('Invalid notion page id', { status: 400 })
32
}
0 commit comments