mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-07 02:07:43 +02:00
Fix card parent loop (#9159)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -403,6 +403,21 @@ async function OnCardCreate (ctx: TxCreateDoc<Card>[], control: TriggerControl):
|
||||
}
|
||||
})
|
||||
)
|
||||
if ((doc.parentInfo?.length ?? 0) === 0) {
|
||||
const parentInfo = [
|
||||
...(parent.parentInfo ?? []),
|
||||
{
|
||||
_id: parent._id,
|
||||
_class: parent._class,
|
||||
title: parent.title
|
||||
}
|
||||
]
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(doc._class, doc.space, doc._id, {
|
||||
parentInfo
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user