Browse Source

fix: if fields value specified as `*` extract all fields

re #1981

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1984/head
Pranav C 3 years ago
parent
commit
454a686a58
  1. 4
      packages/nocodb/src/lib/dataMapper/lib/sql/helpers/getAst.ts

4
packages/nocodb/src/lib/dataMapper/lib/sql/helpers/getAst.ts

@ -17,6 +17,8 @@ const getAst = async ({
view?: View; view?: View;
}) => { }) => {
if (!model.columns?.length) await model.getColumns(); if (!model.columns?.length) await model.getColumns();
// extract only pk and pv
if (extractOnlyPrimaries) { if (extractOnlyPrimaries) {
return { return {
...(model.primaryKeys ...(model.primaryKeys
@ -71,7 +73,7 @@ const getAst = async ({
value = await getAst({ value = await getAst({
model, model,
query: query?.nested, query: query?.nested,
extractOnlyPrimaries: true extractOnlyPrimaries: nestedFields !== '*'
}); });
} }

Loading…
Cancel
Save