From 83a155accad58798ac7ee79ba81c6e1d7839b935 Mon Sep 17 00:00:00 2001 From: Michael Liendo Date: Sun, 3 Sep 2023 15:28:44 -0400 Subject: [PATCH] fix: optional cover file url --- src/lib/utils/Notion/Notes/objectTransformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/Notion/Notes/objectTransformer.ts b/src/lib/utils/Notion/Notes/objectTransformer.ts index 7f3fb56..4ec75ad 100644 --- a/src/lib/utils/Notion/Notes/objectTransformer.ts +++ b/src/lib/utils/Notion/Notes/objectTransformer.ts @@ -4,7 +4,7 @@ export function pageToNoteTransformer(note: NoteResponse): Note { return { id: note.id, icon: note.icon, - cover: note.cover?.external?.url || note.cover.file?.url || null, + cover: note.cover?.external?.url || note.cover?.file?.url || null, title: note.properties.name.title?.at(0)?.plain_text, tags: note.properties.tags.multi_select || [], description: note.properties.description.rich_text?.at(0)?.plain_text,