fix(inline-edit): stop wireMap leaking camelCase unitType on wire

This commit is contained in:
DEls 2026-08-31 13:55:32 +02:00
parent d4862b37e7
commit dc04987454
2 changed files with 16 additions and 8 deletions

View file

@ -311,10 +311,14 @@ export function FuelView({
// eslint-disable-next-line no-alert
window.alert(err instanceof Error ? err.message : "Save failed");
},
wireMap: (changes) => ({
...changes,
unit_type: (changes as Record<string, unknown>).unitType ?? (changes as Record<string, unknown>).unit_type,
}),
wireMap: (changes) => {
const wire: Record<string, unknown> = { ...(changes as Record<string, unknown>) };
if ("unitType" in wire) {
wire.unit_type = wire.unitType;
delete wire.unitType;
}
return wire;
},
});
function handleToggle() {

View file

@ -157,10 +157,14 @@ export function PlantView({
// eslint-disable-next-line no-alert
window.alert(err instanceof Error ? err.message : "Save failed");
},
wireMap: (changes) => ({
...changes,
unit_type: (changes as Record<string, unknown>).unitType ?? (changes as Record<string, unknown>).unit_type,
}),
wireMap: (changes) => {
const wire: Record<string, unknown> = { ...(changes as Record<string, unknown>) };
if ("unitType" in wire) {
wire.unit_type = wire.unitType;
delete wire.unitType;
}
return wire;
},
});
function handleToggle() {