mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +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)
|
||||
if (this.hierarchy.isDerived(object._class, core.class.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(
|
||||
adoc.attachedToClass,
|
||||
adoc.attachedTo,
|
||||
object.space,
|
||||
adoc.space,
|
||||
adoc.collection,
|
||||
nestedTx
|
||||
)
|
||||
result.push(tx)
|
||||
result.push(...(await this.processCollection(ctx, tx)))
|
||||
} else {
|
||||
result.push(factory.createTxRemoveDoc(object._class, object.space, object._id))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user