Browse Source

fix: avoid passing index as arg

pull/7268/head
Pranav C 7 months ago
parent
commit
ff172ae5e3
  1. 8
      packages/nocodb-sdk/src/lib/formulaHelpers.ts
  2. 4
      packages/nocodb/src/services/columns.service.ts

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

@ -255,13 +255,17 @@ export function jsepTreeToFormula(node, isCallExpId = false) {
return (
jsepTreeToFormula(node.callee, true) +
'(' +
node.arguments.map(jsepTreeToFormula).join(', ') +
node.arguments.map((argPt) => jsepTreeToFormula(argPt)).join(', ') +
')'
);
}
if (node.type === 'ArrayExpression') {
return '[' + node.elements.map(jsepTreeToFormula).join(', ') + ']';
return (
'[' +
node.elements.map((elePt) => jsepTreeToFormula(elePt)).join(', ') +
']'
);
}
if (node.type === 'Compound') {

4
packages/nocodb/src/services/columns.service.ts

@ -1215,10 +1215,6 @@ export class ColumnsService {
colBody.formula_raw || colBody.formula,
table.columns,
);
console.log(
colBody.formula_raw ||
colBody.formula?.replaceAll('{{', '{').replaceAll('}}', '}'),
);
colBody.parsed_tree = validateFormulaAndExtractTreeWithType({
// formula may include double curly brackets in previous version
// convert to single curly bracket here for compatibility

Loading…
Cancel
Save