diff --git a/packages/nocodb/src/models/Column.ts b/packages/nocodb/src/models/Column.ts index 484ae6579b..f9996aea0a 100644 --- a/packages/nocodb/src/models/Column.ts +++ b/packages/nocodb/src/models/Column.ts @@ -713,7 +713,11 @@ export default class Column implements ColumnType { title: col?.title, }) ) - await FormulaColumn.update(formulaCol.id, formula, ncMeta); + await FormulaColumn.update( + formulaCol.id, + formula as FormulaColumn & { parsed_tree?: any }, + ncMeta, + ); } } diff --git a/packages/nocodb/src/models/FormulaColumn.ts b/packages/nocodb/src/models/FormulaColumn.ts index d3f1234a44..4c786125e9 100644 --- a/packages/nocodb/src/models/FormulaColumn.ts +++ b/packages/nocodb/src/models/FormulaColumn.ts @@ -16,7 +16,7 @@ export default class FormulaColumn { } public static async insert( - formulaColumn: Partial, + formulaColumn: Partial & { parsed_tree?: any }, ncMeta = Noco.ncMeta, ) { const insertObj = extractProps(formulaColumn, [ @@ -72,7 +72,7 @@ export default class FormulaColumn { 'parsed_tree', ]); - updateObj.parsed_tree = stringifyMetaProp(insertObj, 'parsed_tree'); + updateObj.parsed_tree = stringifyMetaProp(updateObj, 'parsed_tree'); // get existing cache const key = `${CacheScope.COL_FORMULA}:${id}`;