mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-11 04:07:43 +02:00
Cleanup types from spaces when removed (#10268)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -64,5 +64,5 @@
|
||||
</script>
|
||||
|
||||
{#each todos as todo (todo._id)}
|
||||
<Button label={getEmbeddedLabel(todo.title)} on:click={() => checkTodo(todo)} />
|
||||
<Button kind={'primary'} label={getEmbeddedLabel(todo.title)} on:click={() => checkTodo(todo)} />
|
||||
{/each}
|
||||
|
||||
@@ -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