mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 03:11:13 -05:00
Fix: Resolve TypeScript errors
This commit is contained in:
@@ -64,13 +64,13 @@ export function useStatesProvinces(country?: string) {
|
||||
const { data, error } = await supabase
|
||||
.from('locations')
|
||||
.select('state_province')
|
||||
.eq('country', country)
|
||||
.eq('country', country || '')
|
||||
.not('state_province', 'is', null);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
const uniqueStates = Array.from(
|
||||
new Set(data?.map(item => item.state_province) || [])
|
||||
new Set(data?.map(item => item.state_province).filter((s): s is string => s != null) || [])
|
||||
).sort();
|
||||
|
||||
setStatesProvinces(
|
||||
@@ -153,7 +153,7 @@ export function useRideModels(manufacturerId?: string) {
|
||||
const { data, error } = await supabase
|
||||
.from('ride_models')
|
||||
.select('id, name')
|
||||
.eq('manufacturer_id', manufacturerId)
|
||||
.eq('manufacturer_id', manufacturerId || '')
|
||||
.order('name');
|
||||
|
||||
if (error) throw error;
|
||||
@@ -198,7 +198,7 @@ export function useCompanyHeadquarters() {
|
||||
if (error) throw error;
|
||||
|
||||
const uniqueHeadquarters = Array.from(
|
||||
new Set(data?.map(item => item.headquarters_location) || [])
|
||||
new Set(data?.map(item => item.headquarters_location).filter((hq): hq is string => hq != null) || [])
|
||||
).sort();
|
||||
|
||||
setHeadquarters(
|
||||
|
||||
Reference in New Issue
Block a user