remove slug from highlight event

This commit is contained in:
Hongbo Wu
2024-03-22 17:20:37 +08:00
parent d67aea6d8a
commit 1b24a24f7c
2 changed files with 4 additions and 6 deletions

View File

@ -68,9 +68,8 @@ export const createHighlight = async (
EntityType.HIGHLIGHT, EntityType.HIGHLIGHT,
{ {
id: libraryItemId, id: libraryItemId,
slug: newHighlight.libraryItem.slug, originalUrl: newHighlight.libraryItem.originalUrl, // for Readwise
originalUrl: newHighlight.libraryItem.originalUrl, thumbnail: newHighlight.libraryItem.thumbnail, // for Readwise
thumbnail: newHighlight.libraryItem.thumbnail,
highlights: [cleanData], highlights: [cleanData],
}, },
userId userId
@ -122,7 +121,6 @@ export const mergeHighlights = async (
EntityType.HIGHLIGHT, EntityType.HIGHLIGHT,
{ {
id: libraryItemId, id: libraryItemId,
slug: newHighlight.libraryItem.slug,
originalUrl: newHighlight.libraryItem.originalUrl, originalUrl: newHighlight.libraryItem.originalUrl,
thumbnail: newHighlight.libraryItem.thumbnail, thumbnail: newHighlight.libraryItem.thumbnail,
highlights: [newHighlight], highlights: [newHighlight],

View File

@ -101,14 +101,14 @@ export class ReadwiseClient implements IntegrationClient {
text: highlight.quote, text: highlight.quote,
title: item.title, title: item.title,
author: item.author || undefined, author: item.author || undefined,
highlight_url: getHighlightUrl(item.slug as string, highlight.id), highlight_url: getHighlightUrl(item.id, highlight.id),
highlighted_at: highlight.createdAt as string | undefined, highlighted_at: highlight.createdAt as string | undefined,
category, category,
image_url: item.thumbnail || undefined, image_url: item.thumbnail || undefined,
location_type: 'order', location_type: 'order',
note: highlight.annotation || undefined, note: highlight.annotation || undefined,
source_type: 'omnivore', source_type: 'omnivore',
source_url: item.originalUrl as string, source_url: item.originalUrl,
} }
}) })
: [] : []