From dfa551251218f980dc0d71304714b89af26c04bb Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 5 Mar 2024 16:18:15 +0800 Subject: [PATCH] get parentPageId from settings --- packages/api/src/services/integrations/notion.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/api/src/services/integrations/notion.ts b/packages/api/src/services/integrations/notion.ts index 085c20566..85ace7508 100644 --- a/packages/api/src/services/integrations/notion.ts +++ b/packages/api/src/services/integrations/notion.ts @@ -39,7 +39,6 @@ export class NotionClient implements IntegrationClient { baseURL: 'https://api.notion.com/v1', timeout: this._timeout, }) - _parentPageId = process.env.NOTION_PAGE_ID _token: string _client: Client @@ -91,13 +90,9 @@ export class NotionClient implements IntegrationClient { } private _itemToNotionPage = (item: LibraryItem): NotionPage => { - if (!this._parentPageId) { - throw new Error('Notion parent page ID is not set') - } - return { parent: { - page_id: this._parentPageId, + page_id: this._settings.parentPageId, }, cover: item.thumbnail ? {