Browse Source

fix: include fieldsSet wherever necessary

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5379/head
Pranav C 2 years ago
parent
commit
da0a4534d8
  1. 4
      packages/nocodb/src/lib/services/dbData/helpers.ts
  2. 6
      packages/nocodb/src/lib/services/dbData/index.ts

4
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
);

6
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,

Loading…
Cancel
Save