mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-14 07:26:43 +00:00
fix
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user