web: ThermalUnits: onDataChanged

This commit is contained in:
2025-06-25 13:59:07 -05:00
parent 3bf028577e
commit eb3d39b1ab
5 changed files with 165 additions and 20 deletions

View File

@@ -30,6 +30,7 @@ import {
import { ColumnDefinition } from "tabulator-tables";
import { offerDownload } from "../Common/io";
import {
changeThermalUnitData,
createThermalUnit,
deleteGenerator,
renameGenerator,
@@ -194,17 +195,17 @@ const ThermalUnitsComponent = (props: CaseBuilderSectionProps) => {
field: string,
newValue: string,
): ValidationError | null => {
// const [newScenario, err] = changeThermalUnitData(
// name,
// field,
// newValue,
// props.scenario,
// );
// if (err) {
// props.onError(err.message);
// return err;
// }
// props.onDataChanged(newScenario);
const [newScenario, err] = changeThermalUnitData(
name,
field,
newValue,
props.scenario,
);
if (err) {
props.onError(err.message);
return err;
}
props.onDataChanged(newScenario);
return null;
};