|
|
@ -62,7 +62,7 @@ export default class FormulaColumn { |
|
|
|
id: string; |
|
|
|
id: string; |
|
|
|
|
|
|
|
|
|
|
|
static async update( |
|
|
|
static async update( |
|
|
|
id: string, |
|
|
|
columnId: string, |
|
|
|
formula: Partial<FormulaColumn> & { parsed_tree?: any }, |
|
|
|
formula: Partial<FormulaColumn> & { parsed_tree?: any }, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
) { |
|
|
|
) { |
|
|
@ -75,7 +75,7 @@ export default class FormulaColumn { |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
// get existing cache
|
|
|
|
// get existing cache
|
|
|
|
const key = `${CacheScope.COL_FORMULA}:${id}`; |
|
|
|
const key = `${CacheScope.COL_FORMULA}:${columnId}`; |
|
|
|
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT); |
|
|
|
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT); |
|
|
|
if (o) { |
|
|
|
if (o) { |
|
|
|
o = { ...o, ...updateObj }; |
|
|
|
o = { ...o, ...updateObj }; |
|
|
@ -85,7 +85,9 @@ export default class FormulaColumn { |
|
|
|
if ('parsed_tree' in updateObj) |
|
|
|
if ('parsed_tree' in updateObj) |
|
|
|
updateObj.parsed_tree = stringifyMetaProp(updateObj, 'parsed_tree'); |
|
|
|
updateObj.parsed_tree = stringifyMetaProp(updateObj, 'parsed_tree'); |
|
|
|
// set meta
|
|
|
|
// set meta
|
|
|
|
await ncMeta.metaUpdate(null, null, MetaTable.COL_FORMULA, updateObj, id); |
|
|
|
await ncMeta.metaUpdate(null, null, MetaTable.COL_FORMULA, updateObj, { |
|
|
|
|
|
|
|
fk_column_id: columnId, |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public getParsedTree() { |
|
|
|
public getParsedTree() { |
|
|
|