From 37cbbfa768a7b766a81eea498b9ddd6f6f07a00c Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Thu, 23 Oct 2025 09:35:46 +0000 Subject: [PATCH] Improve site management interface to correctly assign customers Update the `sites.tsx` page to correctly handle `customerId` when creating or editing sites, ensuring the customer selection works as expected. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/IcLh7if --- .replit | 8 ++++---- client/src/pages/sites.tsx | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.replit b/.replit index e5bcd37..2934391 100644 --- a/.replit +++ b/.replit @@ -19,6 +19,10 @@ externalPort = 80 localPort = 33035 externalPort = 3001 +[[ports]] +localPort = 37459 +externalPort = 5173 + [[ports]] localPort = 41295 externalPort = 6000 @@ -35,10 +39,6 @@ externalPort = 4200 localPort = 42175 externalPort = 3002 -[[ports]] -localPort = 42423 -externalPort = 5173 - [[ports]] localPort = 43169 externalPort = 5000 diff --git a/client/src/pages/sites.tsx b/client/src/pages/sites.tsx index 1cd0fa2..7e9d102 100644 --- a/client/src/pages/sites.tsx +++ b/client/src/pages/sites.tsx @@ -49,6 +49,7 @@ export default function Sites() { defaultValues: { name: "", address: "", + customerId: undefined, shiftType: "fixed_post", minGuards: 1, requiresArmed: false, @@ -67,6 +68,7 @@ export default function Sites() { defaultValues: { name: "", address: "", + customerId: undefined, shiftType: "fixed_post", minGuards: 1, requiresArmed: false, @@ -139,6 +141,7 @@ export default function Sites() { editForm.reset({ name: site.name, address: site.address, + customerId: site.customerId ?? undefined, location: site.location, shiftType: site.shiftType, minGuards: site.minGuards, @@ -237,15 +240,14 @@ export default function Sites() { name="customerId" render={({ field }) => ( - Cliente - field.onChange(value || undefined)} value={field.value ?? undefined}> - + - Nessun cliente {customers?.map((customer) => ( {customer.name} @@ -524,15 +526,14 @@ export default function Sites() { name="customerId" render={({ field }) => ( - Cliente - field.onChange(value || undefined)} value={field.value ?? undefined}> - + - Nessun cliente {customers?.map((customer) => ( {customer.name}