Browse Source

fix: replace double curly brace

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

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

@ -1097,9 +1097,10 @@ export function validateFormulaAndExtractTreeWithType(
if (col?.uidt === UITypes.Formula) { if (col?.uidt === UITypes.Formula) {
// todo: check for circular reference // todo: check for circular reference
// todo: extract the type and return const formulaRes = col.colOptions?.parsed_tree || validateFormulaAndExtractTreeWithType(
const formulaRes = validateFormulaAndExtractTreeWithType( // formula may include double curly brackets in previous version
col.colOptions.formula, // convert to single curly bracket here for compatibility
col.colOptions.formula.replaceAll('{{', '{').replaceAll('}}', '}'),
columns columns
); );

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

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

Loading…
Cancel
Save