Browse Source

feat: upgrade

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/341/head
Pranav C 3 years ago
parent
commit
96a5ebee85
  1. 10
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

10
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -1173,7 +1173,13 @@ export default abstract class BaseApiBuilder<T extends Noco> implements XcDynami
const metas = 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
// 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)} : {})
}, {title: meta.tn})
XcCache.del([this.projectId, this.dbAlias, 'table', meta.tn].join('::'));
if (!localMetas) {
this.models[meta.tn] = this.getBaseModel(meta)
}
}
// Update metadata of associative table
for (const meta of assocMetas) {

Loading…
Cancel
Save