Browse Source

feat(nocodb): pass column to formulaQueryBuilderv2

pull/4776/head
Wing-Kam Wong 2 years ago
parent
commit
f80bddcc38
  1. 2
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts
  2. 6
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/sortV2.ts

2
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

@ -246,7 +246,7 @@ const parseConditionV2 = async (
const model = await column.getModel(); const model = await column.getModel();
const formula = await column.getColOptions<FormulaColumn>(); const formula = await column.getColOptions<FormulaColumn>();
const builder = ( const builder = (
await formulaQueryBuilderv2(formula.formula, null, knex, model) await formulaQueryBuilderv2(formula.formula, null, knex, model, column)
).builder; ).builder;
return parseConditionV2( return parseConditionV2(
new Filter({ ...filter, value: knex.raw('?', [filter.value]) } as any), new Filter({ ...filter, value: knex.raw('?', [filter.value]) } as any),

6
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/sortV2.ts

@ -51,7 +51,8 @@ export default async function sortV2(
).formula, ).formula,
null, null,
knex, knex,
model model,
column
) )
).builder; ).builder;
qb.orderBy(builder, sort.direction || 'asc'); qb.orderBy(builder, sort.direction || 'asc');
@ -161,7 +162,8 @@ export default async function sortV2(
).formula, ).formula,
null, null,
knex, knex,
model model,
column
) )
).builder; ).builder;

Loading…
Cancel
Save