fix readwise syncing error
This commit is contained in:
@ -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<DeepPartial<Highlight>, ColumnToDeleteType>,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
}
|
||||
})
|
||||
: []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user