From da0a4534d8f31c1b5912ec85333fa368749f1279 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 30 Mar 2023 11:13:23 +0530 Subject: [PATCH] fix: include fieldsSet wherever necessary Signed-off-by: Pranav C --- packages/nocodb/src/lib/services/dbData/helpers.ts | 4 ++-- packages/nocodb/src/lib/services/dbData/index.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/src/lib/services/dbData/helpers.ts b/packages/nocodb/src/lib/services/dbData/helpers.ts index 3e709022ad..7f1353062e 100644 --- a/packages/nocodb/src/lib/services/dbData/helpers.ts +++ b/packages/nocodb/src/lib/services/dbData/helpers.ts @@ -242,7 +242,7 @@ export async function getDbRows(param: { temp = process.hrtime(startTime), elapsed = temp[0] * 1000 + temp[1] / 1000000 ) { - const {ast} = await getAst({ + const {ast, dependencyFields} = await getAst({ query: query, includePkByDefault: false, model: view.model, @@ -250,7 +250,7 @@ export async function getDbRows(param: { }); const rows = await nocoExecute( ast, - await baseModel.list({ ...listArgs, offset, limit }), + await baseModel.list({ ...listArgs, offset, limit, ...dependencyFields }), {}, query ); diff --git a/packages/nocodb/src/lib/services/dbData/index.ts b/packages/nocodb/src/lib/services/dbData/index.ts index 741a2d8377..5a62023a14 100644 --- a/packages/nocodb/src/lib/services/dbData/index.ts +++ b/packages/nocodb/src/lib/services/dbData/index.ts @@ -171,9 +171,9 @@ export async function getFindOne(param: { args.sortArr = JSON.parse(args.sortArrJson); } catch (e) {} - const {ast} = await getAst({ model, query: args, view }) + const {ast, dependencyFields} = await getAst({ model, query: args, view }) - const data = await baseModel.findOne(args); + const data = await baseModel.findOne({ ...args, dependencyFields }); return data ? await nocoExecute( ast, @@ -228,7 +228,7 @@ export async function dataRead( NcError.notFound('Row not found'); } - const { ast } = await getAst({ model, query: param.query, view }) + const { ast, dependencyFields } = await getAst({ model, query: param.query, view }) return await nocoExecute( ast,