|
|
@ -1173,7 +1173,13 @@ export default abstract class BaseApiBuilder<T extends Noco> implements XcDynami |
|
|
|
const metas = new Set<any>(); |
|
|
|
const metas = new Set<any>(); |
|
|
|
const assocMetas = new Set<any>(); |
|
|
|
const assocMetas = new Set<any>(); |
|
|
|
|
|
|
|
|
|
|
|
for (const meta of localMetas || Object.values(this.metas)) { |
|
|
|
if (localMetas) { |
|
|
|
|
|
|
|
for (const meta of localMetas) { |
|
|
|
|
|
|
|
this.metas[meta.tn] = meta; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const meta of Object.values(this.metas)) { |
|
|
|
|
|
|
|
|
|
|
|
// check if table is a Bridge table(or Associative Table) by checking
|
|
|
|
// check if table is a Bridge table(or Associative Table) by checking
|
|
|
|
// number of foreign keys and columns
|
|
|
|
// number of foreign keys and columns
|
|
|
@ -1264,8 +1270,10 @@ export default abstract class BaseApiBuilder<T extends Noco> implements XcDynami |
|
|
|
...(queryParams ? {query_params: JSON.stringify(queryParams)} : {}) |
|
|
|
...(queryParams ? {query_params: JSON.stringify(queryParams)} : {}) |
|
|
|
}, {title: meta.tn}) |
|
|
|
}, {title: meta.tn}) |
|
|
|
XcCache.del([this.projectId, this.dbAlias, 'table', meta.tn].join('::')); |
|
|
|
XcCache.del([this.projectId, this.dbAlias, 'table', meta.tn].join('::')); |
|
|
|
|
|
|
|
if (!localMetas) { |
|
|
|
this.models[meta.tn] = this.getBaseModel(meta) |
|
|
|
this.models[meta.tn] = this.getBaseModel(meta) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Update metadata of associative table
|
|
|
|
// Update metadata of associative table
|
|
|
|
for (const meta of assocMetas) { |
|
|
|
for (const meta of assocMetas) { |
|
|
|