From 79f6a5a84a34fd526e3820455cdf999364c49ad1 Mon Sep 17 00:00:00 2001 From: Thomas Mauran Date: Fri, 29 Sep 2023 18:09:59 +0200 Subject: [PATCH] fix(migrateTenant): clear groups of newly created assets --- lib/modules/asset/AssetService.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/modules/asset/AssetService.ts b/lib/modules/asset/AssetService.ts index 1cbadf2c..fafd9d8a 100644 --- a/lib/modules/asset/AssetService.ts +++ b/lib/modules/asset/AssetService.ts @@ -460,6 +460,18 @@ export class AssetService { } } }); + + // clear the groups + await this.sdk.document.mUpdate( + newEngineId, + InternalCollection.ASSETS, + assetsList.map((assetId) => ({ + _id: assetId, + body: { + groups: [], + }, + })) + ); } catch (error) { await recovery.rollback(); throw new BadRequestError(