mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
copy published date to the recommended item
This commit is contained in:
parent
a7c74cef6f
commit
1056971e89
1 changed files with 21 additions and 20 deletions
|
|
@ -36,30 +36,31 @@ export const addRecommendation = async (
|
|||
thumbnail: item.thumbnail,
|
||||
uploadFile: item.uploadFile,
|
||||
wordCount: item.wordCount,
|
||||
publishedAt: item.publishedAt,
|
||||
}
|
||||
|
||||
recommendedItem = await createLibraryItem(newItem, userId)
|
||||
}
|
||||
|
||||
const highlights = item.highlights
|
||||
?.filter((highlight) => highlightIds?.includes(highlight.id))
|
||||
.map((highlight) => ({
|
||||
shortId: nanoid(8),
|
||||
createdAt: new Date(),
|
||||
libraryItem: { id: recommendedItem?.id },
|
||||
user: { id: userId },
|
||||
quote: highlight.quote,
|
||||
annotation: highlight.annotation,
|
||||
prefix: highlight.prefix,
|
||||
suffix: highlight.suffix,
|
||||
patch: highlight.patch,
|
||||
updatedAt: new Date(),
|
||||
sharedAt: new Date(),
|
||||
html: highlight.html,
|
||||
color: highlight.color,
|
||||
}))
|
||||
if (highlights) {
|
||||
await createHighlights(highlights, userId)
|
||||
const highlights = item.highlights
|
||||
?.filter((highlight) => highlightIds?.includes(highlight.id))
|
||||
.map((highlight) => ({
|
||||
shortId: nanoid(8),
|
||||
createdAt: new Date(),
|
||||
libraryItem: { id: recommendedItem?.id },
|
||||
user: { id: userId },
|
||||
quote: highlight.quote,
|
||||
annotation: highlight.annotation,
|
||||
prefix: highlight.prefix,
|
||||
suffix: highlight.suffix,
|
||||
patch: highlight.patch,
|
||||
updatedAt: new Date(),
|
||||
sharedAt: new Date(),
|
||||
html: highlight.html,
|
||||
color: highlight.color,
|
||||
}))
|
||||
if (highlights) {
|
||||
await createHighlights(highlights, userId)
|
||||
}
|
||||
}
|
||||
|
||||
await createRecommendation(
|
||||
|
|
|
|||
Loading…
Reference in a new issue