mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 04:11:12 -05:00
feat: Add street address to locations
Adds a street_address column to the locations table and updates the LocationSearch component to capture, store, and display full street addresses. This includes database migration, interface updates, and formatter logic.
This commit is contained in:
@@ -57,11 +57,13 @@ export interface LocationInfoSettings {
|
||||
* Location data structure
|
||||
*/
|
||||
export interface LocationData {
|
||||
street_address?: string;
|
||||
country?: string;
|
||||
state_province?: string;
|
||||
city?: string;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
postal_code?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,10 +73,12 @@ export function isLocationData(data: unknown): data is LocationData {
|
||||
if (typeof data !== 'object' || data === null) return false;
|
||||
const loc = data as Record<string, unknown>;
|
||||
return (
|
||||
(loc.street_address === undefined || typeof loc.street_address === 'string') &&
|
||||
(loc.country === undefined || typeof loc.country === 'string') &&
|
||||
(loc.state_province === undefined || typeof loc.state_province === 'string') &&
|
||||
(loc.city === undefined || typeof loc.city === 'string') &&
|
||||
(loc.latitude === undefined || typeof loc.latitude === 'number') &&
|
||||
(loc.longitude === undefined || typeof loc.longitude === 'number')
|
||||
(loc.longitude === undefined || typeof loc.longitude === 'number') &&
|
||||
(loc.postal_code === undefined || typeof loc.postal_code === 'string')
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user