From d7069deaf6566249e9be4897be48de2b576d99b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20=C3=96hlerking?= Date: Wed, 12 Jun 2024 11:50:04 +0200 Subject: [PATCH] fix replace method --- .../src/modules/board/service/content-element.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/modules/board/service/content-element.service.ts b/apps/server/src/modules/board/service/content-element.service.ts index 237b788c6be..8e563b02ac5 100644 --- a/apps/server/src/modules/board/service/content-element.service.ts +++ b/apps/server/src/modules/board/service/content-element.service.ts @@ -69,12 +69,12 @@ export class ContentElementService { } async replace(target: AnyContentElementDo, source: AnyContentElementDo): Promise { - await this.delete(target); - const parent = await this.findParentOfId(target.id); parent.addChild(source); await this.boardDoRepo.save(parent.children, parent); + + await this.delete(target); } async move(element: AnyContentElementDo, targetCard: Card, targetPosition: number): Promise {