From 028b212ecb316df8d7f78479a912f74de8338d86 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 31 Oct 2022 12:45:49 +0800 Subject: [PATCH] Fix readwise api error when image_url is empty by removing image_url from api payload --- packages/api/src/services/integrations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/api/src/services/integrations.ts b/packages/api/src/services/integrations.ts index d10b9e547..cde294253 100644 --- a/packages/api/src/services/integrations.ts +++ b/packages/api/src/services/integrations.ts @@ -69,11 +69,11 @@ const pageToReadwiseHighlight = (page: Page): ReadwiseHighlight[] => { return { text: highlight.quote, title: page.title, - author: page.author, + author: page.author || undefined, highlight_url: getHighlightUrl(page.slug, highlight.id), highlighted_at: new Date(highlight.createdAt).toISOString(), category: 'articles', - image_url: page.image, + image_url: page.image || undefined, location: highlight.highlightPositionPercent || undefined, location_type: 'order', note: highlight.annotation || undefined,