mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 19:44:59 +03:00
Fix derived delete from collection (#2002)
Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
parent
6bb8bf5e1b
commit
8c8ba5c86e
@ -333,15 +333,16 @@ class TServerStorage implements ServerStorage {
|
|||||||
const factory = new TxFactory(core.account.System)
|
const factory = new TxFactory(core.account.System)
|
||||||
if (this.hierarchy.isDerived(object._class, core.class.AttachedDoc)) {
|
if (this.hierarchy.isDerived(object._class, core.class.AttachedDoc)) {
|
||||||
const adoc = object as AttachedDoc
|
const adoc = object as AttachedDoc
|
||||||
const nestedTx = factory.createTxRemoveDoc(object._class, object.space, adoc._id) as TxRemoveDoc<AttachedDoc>
|
const nestedTx = factory.createTxRemoveDoc(adoc._class, adoc.space, adoc._id)
|
||||||
const tx = factory.createTxCollectionCUD(
|
const tx = factory.createTxCollectionCUD(
|
||||||
adoc.attachedToClass,
|
adoc.attachedToClass,
|
||||||
adoc.attachedTo,
|
adoc.attachedTo,
|
||||||
object.space,
|
adoc.space,
|
||||||
adoc.collection,
|
adoc.collection,
|
||||||
nestedTx
|
nestedTx
|
||||||
)
|
)
|
||||||
result.push(tx)
|
result.push(tx)
|
||||||
|
result.push(...(await this.processCollection(ctx, tx)))
|
||||||
} else {
|
} else {
|
||||||
result.push(factory.createTxRemoveDoc(object._class, object.space, object._id))
|
result.push(factory.createTxRemoveDoc(object._class, object.space, object._id))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user