Merge pull request #1593 from omnivore-app/fix/set-labels-for-highlights-conflicts

Not raise error when there is conflict of setting labels in highlights
This commit is contained in:
Hongbo Wu
2022-12-30 11:27:31 +08:00
committed by GitHub

View File

@ -296,16 +296,14 @@ export const setLabelsForHighlight = async (
conflicts: 'proceed', // ignore conflicts
})
if (!body.updated) {
return false
}
for (const label of labels) {
await ctx.pubsub.entityCreated<Label & { highlightId: string }>(
EntityType.LABEL,
{ highlightId, ...label },
ctx.uid
)
if (body.updated > 0) {
for (const label of labels) {
await ctx.pubsub.entityCreated<Label & { highlightId: string }>(
EntityType.LABEL,
{ highlightId, ...label },
ctx.uid
)
}
}
return true