|
|
|
@ -1075,6 +1075,30 @@ export default class Column<T = any> implements ColumnType {
|
|
|
|
|
// set cache
|
|
|
|
|
await NocoCache.set(key, o); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get model column list from cache
|
|
|
|
|
const columnListFromCache = await NocoCache.getList(CacheScope.COLUMN, [ |
|
|
|
|
oldCol.fk_model_id, |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
// update column list in cache if cache exists
|
|
|
|
|
if (!columnListFromCache.list?.length) { |
|
|
|
|
const updatedColumnList = columnListFromCache.list.map((column: any) => { |
|
|
|
|
if (column.id === colId) { |
|
|
|
|
return { |
|
|
|
|
...column, |
|
|
|
|
...updateObj, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
return column; |
|
|
|
|
}); |
|
|
|
|
await NocoCache.setList( |
|
|
|
|
CacheScope.COLUMN, |
|
|
|
|
[oldCol.fk_model_id], |
|
|
|
|
updatedColumnList, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set meta
|
|
|
|
|
await ncMeta.metaUpdate( |
|
|
|
|
null, |
|
|
|
|