From f0e64c46fdd7b56bb01a1692006cd60b17aa5bbd Mon Sep 17 00:00:00 2001 From: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com> Date: Tue, 17 Oct 2023 08:48:38 +0200 Subject: [PATCH] Fix move in call list functionality (#2861) --- .../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; });