From 8c8ba5c86eb3f822cbbc55e1607e86c4bb38b72d Mon Sep 17 00:00:00 2001 From: Anna No Date: Fri, 3 Jun 2022 15:03:48 +0700 Subject: [PATCH] Fix derived delete from collection (#2002) Signed-off-by: Anna No --- server/core/src/storage.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/src/storage.ts b/server/core/src/storage.ts index e39f49396d..852f90f9d1 100644 --- a/server/core/src/storage.ts +++ b/server/core/src/storage.ts @@ -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 + 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)) }