perf: complete performance audit optimizations

This commit is contained in:
2026-02-26 22:17:56 -05:00
parent c9a260ab23
commit a8eaad7f35
14 changed files with 439 additions and 33 deletions

View File

@ -5,14 +5,14 @@ import type { BusStop, Route } from '@/types'
export const busStopsService = {
/** Get all bus stops */
async getAllBusStops(): Promise<BusStop[]> {
const { data, error } = await supabase.from('bus_stops').select('*')
const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, parent_id, side, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at')
if (error) throw new Error(error.message)
return data as BusStop[]
},
/** Get a single bus stop by ID */
async getBusStopById(id: string): Promise<BusStop> {
const { data, error } = await supabase.from('bus_stops').select('*').eq('id', id).single()
const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, parent_id, side, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at').eq('id', id).single()
if (error) throw new Error(error.message)
return data as BusStop
},