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'
| 'mariadb'
| 'sqlite'
| 'snowflake'
| typeof MysqlUi
| typeof MssqlUi
| typeof SnowflakeUi

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

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

Loading…
Cancel
Save