From ed6e7f3d215527d9610c1afa32002be0e865187e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 28 Mar 2023 17:29:48 +0530 Subject: [PATCH] fix: avoid fields from nested ast object Signed-off-by: Pranav C --- .../sql-data-mapper/lib/sql/helpers/getAst.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts index ec32885b5e..d53e8d57c6 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts @@ -95,16 +95,18 @@ const getAst = async ({ .getColOptions() .then((colOpt) => colOpt.getRelatedTable()); - value = await getAst({ - model, - query: query?.nested?.[col.title], - extractOnlyPrimaries: nestedFields !== '*', - dependencyFields: (dependencyFields.nested[col.title] = dependencyFields - .nested[col.title] || { - nested: {}, - fields: new Set(), - }), - }); + value = ( + await getAst({ + model, + query: query?.nested?.[col.title], + extractOnlyPrimaries: nestedFields !== '*', + dependencyFields: (dependencyFields.nested[col.title] = + dependencyFields.nested[col.title] || { + nested: {}, + fields: new Set(), + }), + }) + ).ast; } const isRequested =