Fix: Resolve TypeScript errors

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 02:28:57 +00:00
parent f6c409fac4
commit 9e8e8719b4
14 changed files with 48 additions and 30 deletions

View File

@@ -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(