From 96a5ebee8530efe18ae4fc3596e305f951dbaf2f Mon Sep 17 00:00:00 2001 From: Pranav C <61551451+pranavxc@users.noreply.github.com> Date: Mon, 5 Jul 2021 19:29:56 +0530 Subject: [PATCH] feat: upgrade Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com> --- .../nocodb/src/lib/noco/common/BaseApiBuilder.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts b/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts index 26d96ad85e..bfe357e517 100644 --- a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts +++ b/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts @@ -1173,7 +1173,13 @@ export default abstract class BaseApiBuilder implements XcDynami const metas = new Set(); const assocMetas = new Set(); - 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,7 +1270,9 @@ export default abstract class BaseApiBuilder implements XcDynami ...(queryParams ? {query_params: JSON.stringify(queryParams)} : {}) }, {title: meta.tn}) XcCache.del([this.projectId, this.dbAlias, 'table', meta.tn].join('::')); - this.models[meta.tn] = this.getBaseModel(meta) + if (!localMetas) { + this.models[meta.tn] = this.getBaseModel(meta) + } } // Update metadata of associative table