mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-26 19:26:59 -05:00
Implement strict type enforcement plan
This commit is contained in:
@@ -137,7 +137,7 @@ export function AutocompleteSearch({
|
||||
}
|
||||
break;
|
||||
case 'ride':
|
||||
const parkSlug = (searchResult.data as any)?.park?.slug;
|
||||
const parkSlug = (searchResult.data as { park?: { slug?: string } })?.park?.slug;
|
||||
const rideSlug = searchResult.slug;
|
||||
const rideId = searchResult.id;
|
||||
|
||||
@@ -155,7 +155,7 @@ export function AutocompleteSearch({
|
||||
}
|
||||
break;
|
||||
case 'company':
|
||||
const companyType = (searchResult.data as any)?.company_type;
|
||||
const companyType = (searchResult.data as { company_type?: string })?.company_type;
|
||||
const companySlug = searchResult.slug;
|
||||
|
||||
if (companyType && companySlug) {
|
||||
|
||||
@@ -56,7 +56,7 @@ export function EnhancedSearchResults({ results, loading, hasMore, onLoadMore }:
|
||||
|
||||
const renderParkDetails = (result: SearchResult) => {
|
||||
if (result.type !== 'park') return null;
|
||||
const parkData = result.data as any; // Type assertion for park-specific properties
|
||||
const parkData = result.data as { ride_count?: number; opening_date?: string; status?: string };
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap gap-2 mt-3">
|
||||
@@ -83,7 +83,7 @@ export function EnhancedSearchResults({ results, loading, hasMore, onLoadMore }:
|
||||
|
||||
const renderRideDetails = (result: SearchResult) => {
|
||||
if (result.type !== 'ride') return null;
|
||||
const rideData = result.data as any; // Type assertion for ride-specific properties
|
||||
const rideData = result.data as { category?: string; max_height_meters?: number; max_speed_kmh?: number; intensity_level?: string };
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap gap-2 mt-3">
|
||||
@@ -115,7 +115,7 @@ export function EnhancedSearchResults({ results, loading, hasMore, onLoadMore }:
|
||||
|
||||
const renderCompanyDetails = (result: SearchResult) => {
|
||||
if (result.type !== 'company') return null;
|
||||
const companyData = result.data as any; // Type assertion for company-specific properties
|
||||
const companyData = result.data as { company_type?: string; founded_year?: number; headquarters_location?: string };
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap gap-2 mt-3">
|
||||
|
||||
Reference in New Issue
Block a user