Skip to content

Commit

Permalink
add check to server to not allow detached nodes with parent
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Dec 5, 2023
1 parent 2a04afc commit a6de63b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teammapper-backend/src/map/services/maps.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export class MapsService {
}

async addNode(mapId: string, clientNode: IMmpClientNode): Promise<MmpNode> {
// 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 },
});
Expand Down

0 comments on commit a6de63b

Please sign in to comment.