mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 22:15:04 +02:00
Cleanup types from spaces when removed (#10268)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -155,6 +155,16 @@ async function OnMasterTagRemove (ctx: TxUpdateDoc<MasterTag>[], control: Trigge
|
||||
for (const des of desc) {
|
||||
res.push(...(await removeTagRelations(control, des)))
|
||||
}
|
||||
const spaces = await control.findAll(control.ctx, card.class.CardSpace, {
|
||||
types: updateTx.objectId
|
||||
})
|
||||
for (const space of spaces) {
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(space._class, space.space, space._id, {
|
||||
types: space.types.filter((t) => t !== updateTx.objectId)
|
||||
})
|
||||
)
|
||||
}
|
||||
for (const des of desc) {
|
||||
if (des === updateTx.objectId) continue
|
||||
const _class = control.hierarchy.findClass(des)
|
||||
|
||||
Reference in New Issue
Block a user