mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-02 14:29:03 +02:00
Add tag process fixes (#10561)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -323,11 +323,20 @@ export async function AddTag (
|
||||
res.push(tx)
|
||||
const card = control.cache.get(execution.card)
|
||||
if (card === undefined) throw processError(process.error.ObjectNotFound, { _id: execution.card })
|
||||
if (control.client.getHierarchy().hasMixin(card, tagId)) {
|
||||
return { txes: res, rollback: [], context: null }
|
||||
}
|
||||
const cardWithMixin =
|
||||
card !== undefined ? TxProcessor.updateMixin4Doc(control.client.getHierarchy().clone(card), tx) : undefined
|
||||
if (control.client.getHierarchy().hasMixin(card, tagId)) {
|
||||
return {
|
||||
txes: res,
|
||||
rollback: [],
|
||||
context: [
|
||||
{
|
||||
_id: execution.card,
|
||||
value: cardWithMixin
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
const rollback: Tx[] = [
|
||||
control.client.txFactory.createTxUpdateDoc(_process.masterTag, execution.space, execution.card, {
|
||||
|
||||
Reference in New Issue
Block a user