From 44178c1c1ef6ba089979d556664d090b7549c384 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 7 Mar 2024 13:24:02 +0800 Subject: [PATCH] Add author --- .../api/src/services/integrations/notion.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/api/src/services/integrations/notion.ts b/packages/api/src/services/integrations/notion.ts index b695b3737..4a21d5606 100644 --- a/packages/api/src/services/integrations/notion.ts +++ b/packages/api/src/services/integrations/notion.ts @@ -53,6 +53,13 @@ interface NotionPage { } ] } + Author: { + rich_text: Array<{ + text: { + content: string + } + }> + } 'Original URL': { url: string | null } @@ -185,6 +192,15 @@ export class NotionClient implements IntegrationClient { }, ], }, + Author: { + rich_text: [ + { + text: { + content: item.author || 'unknown', + }, + }, + ], + }, 'Original URL': { url: item.originalUrl, }, @@ -210,7 +226,7 @@ export class NotionClient implements IntegrationClient { }, { text: { - content: highlight.annotation || '', + content: `\n${highlight.annotation || ''}`, }, annotations: { italic: true, @@ -264,6 +280,9 @@ export class NotionClient implements IntegrationClient { Title: { title: {}, }, + Author: { + rich_text: {}, + }, 'Original URL': { url: {}, },