Browse Source

fix: define nested and fieldSet default value if missing

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/query-opt-imp
Pranav C 2 years ago
parent
commit
ad2024a6bd
  1. 4
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts

4
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts

@ -26,6 +26,10 @@ const getAst = async ({
view?: View; view?: View;
dependencyFields?: DependantFields; dependencyFields?: DependantFields;
}) => { }) => {
// set default values of dependencyFields and nested
dependencyFields.nested = dependencyFields.nested || {};
dependencyFields.fieldsSet = dependencyFields.fieldsSet || new Set();
if (!model.columns?.length) await model.getColumns(); if (!model.columns?.length) await model.getColumns();
// extract only pk and pv // extract only pk and pv

Loading…
Cancel
Save