From dc0498745455e6cb067fe43cbddc2f2acdf2854b Mon Sep 17 00:00:00 2001 From: DEls Date: Mon, 31 Aug 2026 13:55:32 +0200 Subject: [PATCH] fix(inline-edit): stop wireMap leaking camelCase unitType on wire --- src/app/dashboard/fuel/fuel-view.tsx | 12 ++++++++---- src/app/dashboard/plant/plant-view.tsx | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/fuel/fuel-view.tsx b/src/app/dashboard/fuel/fuel-view.tsx index 2411c74..8542ed9 100644 --- a/src/app/dashboard/fuel/fuel-view.tsx +++ b/src/app/dashboard/fuel/fuel-view.tsx @@ -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).unitType ?? (changes as Record).unit_type, - }), + wireMap: (changes) => { + const wire: Record = { ...(changes as Record) }; + if ("unitType" in wire) { + wire.unit_type = wire.unitType; + delete wire.unitType; + } + return wire; + }, }); function handleToggle() { diff --git a/src/app/dashboard/plant/plant-view.tsx b/src/app/dashboard/plant/plant-view.tsx index a545356..2e80c18 100644 --- a/src/app/dashboard/plant/plant-view.tsx +++ b/src/app/dashboard/plant/plant-view.tsx @@ -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).unitType ?? (changes as Record).unit_type, - }), + wireMap: (changes) => { + const wire: Record = { ...(changes as Record) }; + if ("unitType" in wire) { + wire.unit_type = wire.unitType; + delete wire.unitType; + } + return wire; + }, }); function handleToggle() {