delete all the labels and highlights attached to the item when item was deleted

This commit is contained in:
Hongbo Wu
2024-01-16 17:46:23 +08:00
parent 4fda03e633
commit 242e6e0fa3
3 changed files with 66 additions and 18 deletions

View File

@ -76,6 +76,7 @@ import {
createOrUpdateLibraryItem,
findLibraryItemsByPrefix,
searchLibraryItems,
softDeleteLibraryItem,
sortParamsToSort,
updateLibraryItem,
updateLibraryItemReadingProgress,
@ -532,15 +533,7 @@ export const setBookmarkArticleResolver = authorized<
}
// delete the item and its metadata
const deletedLibraryItem = await updateLibraryItem(
articleID,
{
state: LibraryItemState.Deleted,
deletedAt: new Date(),
},
uid,
pubsub
)
const deletedLibraryItem = await softDeleteLibraryItem(articleID, uid, pubsub)
analytics.track({
userId: uid,