From 6a63f54bc1cc61dc1379e15fee37fc0f5b98caa8 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Thu, 23 Oct 2025 13:49:23 +0000 Subject: [PATCH] Fix issue with undefined coordinates when editing site information Update the site editing form in `client/src/pages/sites.tsx` to initialize latitude and longitude fields with empty strings instead of undefined, resolving the "address undefined" error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/HdlP8Fl --- .replit | 6 +++++- client/src/pages/sites.tsx | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.replit b/.replit index 75d108a..e477c56 100644 --- a/.replit +++ b/.replit @@ -20,9 +20,13 @@ localPort = 33035 externalPort = 3001 [[ports]] -localPort = 41295 +localPort = 33963 externalPort = 5173 +[[ports]] +localPort = 41295 +externalPort = 6000 + [[ports]] localPort = 41343 externalPort = 3000 diff --git a/client/src/pages/sites.tsx b/client/src/pages/sites.tsx index 22e6f39..ff5972c 100644 --- a/client/src/pages/sites.tsx +++ b/client/src/pages/sites.tsx @@ -220,6 +220,8 @@ export default function Sites() { editForm.reset({ name: site.name, address: site.address, + latitude: site.latitude || "", + longitude: site.longitude || "", customerId: site.customerId ?? undefined, location: site.location, serviceTypeId: site.serviceTypeId ?? undefined, @@ -231,8 +233,6 @@ export default function Sites() { contractEndDate: site.contractEndDate || undefined, serviceStartTime: site.serviceStartTime || "", serviceEndTime: site.serviceEndTime || "", - latitude: site.latitude || undefined, - longitude: site.longitude || undefined, isActive: site.isActive, }); };