mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 21:27:46 +02:00
Remove favorite on card removed (#9364)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -282,6 +282,10 @@ async function OnCardRemove (ctx: TxRemoveDoc<Card>[], control: TriggerControl):
|
||||
})
|
||||
)
|
||||
}
|
||||
const favorites = await control.findAll(control.ctx, card.class.FavoriteCard, { attachedTo: removedCard._id })
|
||||
for (const favorite of favorites) {
|
||||
res.push(control.txFactory.createTxRemoveDoc(favorite._class, favorite.space, favorite._id))
|
||||
}
|
||||
|
||||
const event: RemoveCardEvent = {
|
||||
type: CardEventType.RemoveCard,
|
||||
|
||||
Reference in New Issue
Block a user