Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Nov 8, 2024
1 parent 6394b01 commit dd3154e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/api/social-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
getBlockIcon,
getBlockTitle,
getPageProperty,
isUrl
isUrl,
parsePageId
} from 'notion-utils'

import * as libConfig from '@/lib/config'
Expand All @@ -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 })
}
Expand Down

0 comments on commit dd3154e

Please sign in to comment.