Skip to content

Commit 59818f2

Browse files
committed
replace got by fetch
1 parent ee11320 commit 59818f2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/lib/db.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
QueryDatabaseResponse,
66
RichTextItemResponse
77
} from '@notionhq/client/build/src/api-endpoints'
8-
import got from 'got'
98
import { get, set } from 'lodash'
109
import { CollectionInstance, SearchParams } from 'notion-types'
1110
import ogs from 'open-graph-scraper'
@@ -403,10 +402,9 @@ export async function searchNotion(
403402

404403
const url = `${apiUrl}/search`
405404

406-
return got
407-
.post(url, {
408-
body: JSON.stringify(body),
409-
headers
410-
})
411-
.json()
405+
return fetch(url, {
406+
method: 'POST',
407+
headers: headers,
408+
body: JSON.stringify(body)
409+
}).then(response => response.json())
412410
}

0 commit comments

Comments
 (0)