From 6f1d83ad8f3fd1a762a927481cc83862dfb61b99 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Fri, 17 Oct 2025 08:46:13 +0000 Subject: [PATCH] Saved your changes before starting work Replit-Commit-Author: Agent Replit-Commit-Session-Id: 94491beb-cc63-4877-b64a-41f1e2a4c43a Replit-Commit-Checkpoint-Type: full_checkpoint --- client/src/pages/vehicles.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/pages/vehicles.tsx b/client/src/pages/vehicles.tsx index 82f35f0..79ed898 100644 --- a/client/src/pages/vehicles.tsx +++ b/client/src/pages/vehicles.tsx @@ -143,7 +143,11 @@ export default function Vehicles() { const createVehicleMutation = useMutation({ mutationFn: async (data: VehicleForm) => { - return apiRequest("POST", "/api/vehicles", data); + const payload = { + ...data, + assignedGuardId: data.assignedGuardId === "unassigned" ? null : data.assignedGuardId, + }; + return apiRequest("POST", "/api/vehicles", payload); }, onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["/api/vehicles"] }); @@ -518,7 +522,7 @@ export default function Vehicles() { - Nessuno + Nessuno {guards?.map(guard => ( {guard.badgeNumber} @@ -745,7 +749,7 @@ export default function Vehicles() { - Nessuno + Nessuno {guards?.map(guard => ( {guard.badgeNumber}