|
@@ -63,8 +63,13 @@ class TableService extends CrudService {
|
|
|
for (const dir of dirs) {
|
|
|
const { _id, children = [] } = dir;
|
|
|
const dts = tables.filter((f) => ObjectId(f.dir).equals(_id));
|
|
|
- dir.tables = dts;
|
|
|
- if (children.length <= 0) continue;
|
|
|
+ if (children.length <= 0) {
|
|
|
+ children.push(...dts);
|
|
|
+ dir.children = children;
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ dir.children.push(...dts);
|
|
|
+ }
|
|
|
const othersTables = tables.filter((f) => !ObjectId(f.dir).equals(_id));
|
|
|
dir.children = this.compareTablesForDir(children, othersTables);
|
|
|
}
|