File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 3636 "fathom-client" : " ^3.4.1" ,
3737 "got" : " ^12.0.3" ,
3838 "isomorphic-unfetch" : " ^3.1.0" ,
39- "ky" : " ^0.31.4" ,
4039 "lqip-modern" : " ^1.2.0" ,
4140 "next" : " ^12.3.1" ,
4241 "notion-client" : " ^6.15.6" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import * as React from 'react'
22import { NextRequest } from 'next/server'
33
44import { ImageResponse } from '@vercel/og'
5- import ky from 'ky'
65
76import { api , apiHost } from '@/lib/config'
87import { NotionPageInfo } from '@/lib/types'
@@ -31,11 +30,17 @@ export default async function OGImage(req: NextRequest) {
3130 return new Response ( 'Invalid notion page id' , { status : 400 } )
3231 }
3332
34- const pageInfo = await ky
35- . post ( `${ apiHost } ${ api . getNotionPageInfo } ` , {
36- json : { pageId }
37- } )
38- . json < NotionPageInfo > ( )
33+ const pageInfoRes = await fetch ( `${ apiHost } ${ api . getNotionPageInfo } ` , {
34+ method : 'POST' ,
35+ body : JSON . stringify ( { pageId } ) ,
36+ headers : {
37+ 'content-type' : 'application/json'
38+ }
39+ } )
40+ if ( ! pageInfoRes . ok ) {
41+ return new Response ( pageInfoRes . statusText , { status : pageInfoRes . status } )
42+ }
43+ const pageInfo : NotionPageInfo = await pageInfoRes . json ( )
3944 console . log ( pageInfo )
4045
4146 return new ImageResponse (
Original file line number Diff line number Diff line change @@ -2233,11 +2233,6 @@ keyv@^4.0.0:
22332233 compress-brotli "^1.3.6"
22342234 json-buffer "3.0.1"
22352235
2236- ky@^0.31.4 :
2237- version "0.31.4"
2238- resolved "https://registry.yarnpkg.com/ky/-/ky-0.31.4.tgz#c629a707053a92611cefa23079a0b0b60131b4b4"
2239- integrity sha512-OFuAD3riwhAfHK3J4FrhlujFRpm0ELBEfDHZfFpw89OTozQt3NLF39lNblUO5udj5vSkyaBKnLai/rFCzBfISQ==
2240-
22412236levn@^0.4.1 :
22422237 version "0.4.1"
22432238 resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz"
You can’t perform that action at this time.
0 commit comments