fixes: table crash due to columnDeletionHistory saved as an object instead of an array

This commit is contained in:
arpitnath 2023-10-19 19:51:35 +05:30
parent d18f478c21
commit 2763bd33ad

View file

@ -112,11 +112,26 @@ export const computeComponentPropertyDiff = (appDiff, definition, opts) => {
if (!opts?.isParamFromTableColumn) {
return appDiff;
}
const path = generatePath(appDiff, 'columns') || generatePath(appDiff, 'actions');
const columnsPath = generatePath(appDiff, 'columns');
const actionsPath = generatePath(appDiff, 'actions');
const deletionHistoryPath = generatePath(appDiff, 'columnDeletionHistory');
const value2 = getValueFromJson(definition, path);
let _diff = _.cloneDeep(appDiff);
const _diff = updateValueInJson(_.cloneDeep(appDiff), path, value2);
if (columnsPath) {
const columnsValue = getValueFromJson(definition, columnsPath);
_diff = updateValueInJson(_diff, columnsPath, columnsValue);
}
if (actionsPath) {
const actionsValue = getValueFromJson(definition, actionsPath);
_diff = updateValueInJson(_diff, actionsPath, actionsValue);
}
if (deletionHistoryPath) {
const deletionHistoryValue = getValueFromJson(definition, deletionHistoryPath);
_diff = updateValueInJson(_diff, deletionHistoryPath, deletionHistoryValue);
}
return _diff;
};