From a6de63b0eb8f25c999815c624561a2d051cb3b8b Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Tue, 5 Dec 2023 13:19:16 +0100 Subject: [PATCH] add check to server to not allow detached nodes with parent --- teammapper-backend/src/map/services/maps.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/teammapper-backend/src/map/services/maps.service.ts b/teammapper-backend/src/map/services/maps.service.ts index b8dfa2aa..506511b0 100644 --- a/teammapper-backend/src/map/services/maps.service.ts +++ b/teammapper-backend/src/map/services/maps.service.ts @@ -32,6 +32,9 @@ export class MapsService { } async addNode(mapId: string, clientNode: IMmpClientNode): Promise { + // detached nodes are not allowed to have a parent + if (clientNode.detached && clientNode.parent) return + const existingNode = await this.nodesRepository.findOne({ where: { id: clientNode.id, nodeMapId: mapId }, });