mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-30 03:07:05 -05:00
Compare commits
3 Commits
338c30e65c
...
64f82c9ac2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64f82c9ac2 | ||
|
|
ac65e4b4db | ||
|
|
5197041d37 |
8
.replit
8
.replit
@@ -38,6 +38,10 @@ externalPort = 80
|
|||||||
localPort = 5001
|
localPort = 5001
|
||||||
externalPort = 3000
|
externalPort = 3000
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 34475
|
||||||
|
externalPort = 3003
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 37143
|
localPort = 37143
|
||||||
externalPort = 3001
|
externalPort = 3001
|
||||||
@@ -45,7 +49,3 @@ externalPort = 3001
|
|||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 37623
|
localPort = 37623
|
||||||
externalPort = 3002
|
externalPort = 3002
|
||||||
|
|
||||||
[[ports]]
|
|
||||||
localPort = 44381
|
|
||||||
externalPort = 3003
|
|
||||||
|
|||||||
@@ -146,18 +146,23 @@ export function LocationSearch({ onLocationSelect, initialLocationId, className
|
|||||||
const latitude = parseFloat(result.lat);
|
const latitude = parseFloat(result.lat);
|
||||||
const longitude = parseFloat(result.lon);
|
const longitude = parseFloat(result.lon);
|
||||||
|
|
||||||
const city = result.address.city || result.address.town || result.address.village;
|
// Safely access address properties with fallback
|
||||||
|
const address = result.address || {};
|
||||||
|
const city = address.city || address.town || address.village;
|
||||||
|
const state = address.state || '';
|
||||||
|
const country = address.country || 'Unknown';
|
||||||
|
|
||||||
const locationName = city
|
const locationName = city
|
||||||
? `${city}, ${result.address.state || ''} ${result.address.country}`.trim()
|
? `${city}, ${state} ${country}`.trim()
|
||||||
: result.display_name;
|
: result.display_name;
|
||||||
|
|
||||||
// Build location data object (no database operations)
|
// Build location data object (no database operations)
|
||||||
const locationData: SelectedLocation = {
|
const locationData: SelectedLocation = {
|
||||||
name: locationName,
|
name: locationName,
|
||||||
city: city || undefined,
|
city: city || undefined,
|
||||||
state_province: result.address.state || undefined,
|
state_province: state || undefined,
|
||||||
country: result.address.country || '',
|
country: country,
|
||||||
postal_code: result.address.postcode || undefined,
|
postal_code: address.postcode || undefined,
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
timezone: undefined, // Will be set by server during approval if needed
|
timezone: undefined, // Will be set by server during approval if needed
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ serve(async (req) => {
|
|||||||
requestId: tracking.requestId
|
requestId: tracking.requestId
|
||||||
});
|
});
|
||||||
|
|
||||||
endRequest(tracking, 200);
|
endRequest(tracking);
|
||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
JSON.stringify({ ...result, requestId: tracking.requestId }),
|
JSON.stringify({ ...result, requestId: tracking.requestId }),
|
||||||
@@ -284,7 +284,7 @@ serve(async (req) => {
|
|||||||
requestId: tracking.requestId
|
requestId: tracking.requestId
|
||||||
});
|
});
|
||||||
|
|
||||||
endRequest(tracking, 500, errorMessage);
|
endRequest(tracking);
|
||||||
|
|
||||||
// Return default (metric) with 500 status to indicate error occurred
|
// Return default (metric) with 500 status to indicate error occurred
|
||||||
// This allows proper error monitoring while still providing fallback data
|
// This allows proper error monitoring while still providing fallback data
|
||||||
|
|||||||
Reference in New Issue
Block a user