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 36
36
"fathom-client" : " ^3.4.1" ,
37
37
"got" : " ^12.0.3" ,
38
38
"isomorphic-unfetch" : " ^3.1.0" ,
39
- "ky" : " ^0.31.4" ,
40
39
"lqip-modern" : " ^1.2.0" ,
41
40
"next" : " ^12.3.1" ,
42
41
"notion-client" : " ^6.15.6" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import * as React from 'react'
2
2
import { NextRequest } from 'next/server'
3
3
4
4
import { ImageResponse } from '@vercel/og'
5
- import ky from 'ky'
6
5
7
6
import { api , apiHost } from '@/lib/config'
8
7
import { NotionPageInfo } from '@/lib/types'
@@ -31,11 +30,17 @@ export default async function OGImage(req: NextRequest) {
31
30
return new Response ( 'Invalid notion page id' , { status : 400 } )
32
31
}
33
32
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 ( )
39
44
console . log ( pageInfo )
40
45
41
46
return new ImageResponse (
Original file line number Diff line number Diff line change @@ -2233,11 +2233,6 @@ keyv@^4.0.0:
2233
2233
compress-brotli "^1.3.6"
2234
2234
json-buffer "3.0.1"
2235
2235
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
-
2241
2236
levn@^0.4.1 :
2242
2237
version "0.4.1"
2243
2238
resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz"
You can’t perform that action at this time.
0 commit comments