Browse Source

fix: method usage correction

pull/7268/head
Pranav C 11 months ago
parent
commit
20f1c04e7e
  1. 1
      packages/nocodb-sdk/src/lib/formulaHelpers.ts
  2. 10
      packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

1
packages/nocodb-sdk/src/lib/formulaHelpers.ts

@ -1202,6 +1202,7 @@ export function validateFormulaAndExtractTreeWithType({
| 'oracledb' | 'oracledb'
| 'mariadb' | 'mariadb'
| 'sqlite' | 'sqlite'
| 'snowflake'
| typeof MysqlUi | typeof MysqlUi
| typeof MssqlUi | typeof MssqlUi
| typeof SnowflakeUi | typeof SnowflakeUi

10
packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

@ -21,6 +21,7 @@ import {
validateDateWithUnknownFormat, validateDateWithUnknownFormat,
} from '~/helpers/formulaFnHelper'; } from '~/helpers/formulaFnHelper';
import FormulaColumn from '~/models/FormulaColumn'; import FormulaColumn from '~/models/FormulaColumn';
import { Source } from '~/models';
const logger = new Logger('FormulaQueryBuilderv2'); const logger = new Logger('FormulaQueryBuilderv2');
@ -76,10 +77,13 @@ async function _formulaQueryBuilder(
// formula may include double curly brackets in previous version // formula may include double curly brackets in previous version
// convert to single curly bracket here for compatibility // convert to single curly bracket here for compatibility
// const _tree1 = jsep(_tree.replaceAll('{{', '{').replaceAll('}}', '}')); // const _tree1 = jsep(_tree.replaceAll('{{', '{').replaceAll('}}', '}'));
tree = validateFormulaAndExtractTreeWithType( tree = validateFormulaAndExtractTreeWithType({
_tree.replaceAll('{{', '{').replaceAll('}}', '}'), formula: _tree.replaceAll('{{', '{').replaceAll('}}', '}'),
columns, columns,
); clientOrSqlUi: await Source.get(column.source_id).then(
(source) => source.type,
),
});
// populate and save parsedTree to column if not exist // populate and save parsedTree to column if not exist
if (column) { if (column) {

Loading…
Cancel
Save