web: ThermalUnits: CSV upload

This commit is contained in:
2025-06-25 13:17:04 -05:00
parent 3f10ad23ca
commit 3bf028577e
8 changed files with 366 additions and 157 deletions

View File

@@ -51,6 +51,18 @@ export const parseNumber = (
}
};
export const parseBool = (
valueStr: string,
): [boolean, ValidationError | null] => {
if (["true", "1"].includes(valueStr.toLowerCase())) {
return [true, null];
}
if (["false", "0"].includes(valueStr.toLowerCase())) {
return [false, null];
}
return [true, { message: `"${valueStr}" is not a valid boolean value` }];
};
export const changeStringData = (
field: string,
newValue: string,