Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions lib/notion/index.ts
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 1 addition & 5 deletions lib/notion/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import notion from "./index";
export const addSignedUrls: NotionAPI["addSignedUrls"] = async ({
recordMap,
contentBlockIds,
kyOptions,
}) => {
recordMap.signed_urls = {};

Expand Down Expand Up @@ -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()) {
Expand Down
Loading