for (const node of nodes) {
        if (node.nodes && node.nodes.length > 0) {
          ids = [...ids, ...this.collectAllChildren(node.nodes, ids)];
        } else {
          ids.push(node.id);