From fd25f6c313e666c55cb6c8613265f75510dc4b64 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 6 Oct 2023 14:15:59 +0200 Subject: [PATCH] Fix move in call list functionality --- .../sorting/modules/sorting-tree/services/tree.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts b/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts index 4daa33bbd9..c7b084156b 100644 --- a/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts +++ b/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts @@ -177,6 +177,7 @@ export class TreeService { /** * Removes the `item`-property from any node in the given tree. + * Deletes empty children-arrays. * * @param tree The tree with items * @returns The tree without items @@ -188,7 +189,7 @@ export class TreeService { id: node.id }; if (node.children) { - nodeWithoutItem.children = this.stripTree(node.children); + nodeWithoutItem.children = node.children.length ? this.stripTree(node.children) : undefined; } return nodeWithoutItem; });