mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: Sorting by dynamic query.
This commit is contained in:
@@ -37,12 +37,12 @@ export default class NestedSet {
|
||||
|
||||
toTree() {
|
||||
const map = this.linkChildren();
|
||||
const tree = {};
|
||||
const tree = [];
|
||||
|
||||
this.items.forEach((item) => {
|
||||
const parentNodeId = item[this.options.parentId];
|
||||
if (!parentNodeId) {
|
||||
tree[item.id] = map[item.id];
|
||||
tree.push(map[item.id]);
|
||||
}
|
||||
});
|
||||
this.collection = Object.values(tree);
|
||||
|
||||
Reference in New Issue
Block a user