fix(inline-edit): stop wireMap leaking camelCase unitType on wire
This commit is contained in:
parent
d4862b37e7
commit
dc04987454
2 changed files with 16 additions and 8 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue