Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: remove kyOptions from notion

Marc Seitzcb5f516e6170
diff --git a/lib/notion/index.ts b/lib/notion/index.ts
index 45d07a3f..077bcdfe 100644
--- a/lib/notion/index.ts
+++ b/lib/notion/index.ts
@@ -1,26 +1,4 @@
import { NotionAPI } from "notion-client";
-const notion = new NotionAPI({
- kyOptions: {
- hooks: {
- beforeRequest: [
- (request, options) => {
- const url = request.url.toString();
-
- if (url.includes("/api/v3/syncRecordValues")) {
- return new Request(
- url.replace(
- "/api/v3/syncRecordValues",
- "/api/v3/syncRecordValuesMain",
- ),
- options,
- );
- }
-
- return request;
- },
- ],
- },
- },
-});
+const notion = new NotionAPI();
export default notion;
diff --git a/lib/notion/utils.ts b/lib/notion/utils.ts
index 53f45c4a..1bfb684e 100644
--- a/lib/notion/utils.ts
+++ b/lib/notion/utils.ts
@@ -6,7 +6,6 @@ import notion from "./index";
export const addSignedUrls: NotionAPI["addSignedUrls"] = async ({
recordMap,
contentBlockIds,
- kyOptions,
}) => {
recordMap.signed_urls = {};
@@ -53,10 +52,7 @@ export const addSignedUrls: NotionAPI["addSignedUrls"] = async ({
if (allFileInstances.length > 0) {
try {
- const { signedUrls } = await notion.getSignedFileUrls(
- allFileInstances,
- kyOptions,
- );
+ const { signedUrls } = await notion.getSignedFileUrls(allFileInstances);
if (signedUrls.length === allFileInstances.length) {
for (const [i, file] of allFileInstances.entries()) {