diff --git a/packages/api/src/services/highlights.ts b/packages/api/src/services/highlights.ts index 73a1bcb35..469949bb1 100644 --- a/packages/api/src/services/highlights.ts +++ b/packages/api/src/services/highlights.ts @@ -13,7 +13,7 @@ import { enqueueUpdateHighlight } from '../utils/createTask' import { deepDelete } from '../utils/helpers' import { ItemEvent } from './library_item' -const columnToDelete = ['user', 'sharedAt'] as const +const columnToDelete = ['user', 'sharedAt', 'libraryItem'] as const type ColumnToDeleteType = typeof columnToDelete[number] export type HighlightEvent = Merge< Omit, ColumnToDeleteType>, diff --git a/packages/api/src/services/integrations/notion.ts b/packages/api/src/services/integrations/notion.ts index fb1667c56..b68550e73 100644 --- a/packages/api/src/services/integrations/notion.ts +++ b/packages/api/src/services/integrations/notion.ts @@ -184,6 +184,11 @@ export class NotionClient implements IntegrationClient { settings: Settings, lastSync?: Date | null ): NotionPage => { + // logger.info('itemToNotionPage', { + // highlights: item.highlights, + // settings, + // lastSync, + // }) return { parent: { database_id: settings.parentDatabaseId, diff --git a/packages/api/src/services/integrations/readwise.ts b/packages/api/src/services/integrations/readwise.ts index b0e0e3459..dc17f3e87 100644 --- a/packages/api/src/services/integrations/readwise.ts +++ b/packages/api/src/services/integrations/readwise.ts @@ -96,21 +96,23 @@ export class ReadwiseClient implements IntegrationClient { ? item.highlights // filter out highlights that are not of type highlight or have no quote .filter(isHighlight) - .map((highlight) => ({ - text: highlight.quote, - title: item.title, - author: item.author || undefined, - highlight_url: item.slug - ? getHighlightUrl(item.slug, highlight.id) - : undefined, - highlighted_at: (highlight.createdAt as Date).toISOString(), - category, - image_url: item.thumbnail || undefined, - location_type: 'order', - note: highlight.annotation || undefined, - source_type: 'omnivore', - source_url: item.originalUrl, - })) + .map((highlight) => { + return { + text: highlight.quote, + title: item.title, + author: item.author || undefined, + highlight_url: item.slug + ? getHighlightUrl(item.slug, highlight.id) + : undefined, + highlighted_at: highlight.createdAt as string | undefined, + category, + image_url: item.thumbnail || undefined, + location_type: 'order', + note: highlight.annotation || undefined, + source_type: 'omnivore', + source_url: item.originalUrl, + } + }) : [] }