perf: complete performance audit optimizations
This commit is contained in:
@ -18,14 +18,14 @@ export const businessService = {
|
||||
|
||||
/** Get all businesses */
|
||||
async getAllBusinesses(): Promise<Business[]> {
|
||||
const { data, error } = await supabase.from('businesses').select('*')
|
||||
const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, updated_at')
|
||||
if (error) throw new Error(error.message)
|
||||
return data as Business[]
|
||||
},
|
||||
|
||||
/** Get a single business by ID */
|
||||
async getBusiness(id: string): Promise<Business> {
|
||||
const { data, error } = await supabase.from('businesses').select('*').eq('id', id).single()
|
||||
const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, updated_at').eq('id', id).single()
|
||||
if (error) throw new Error(error.message)
|
||||
return data as Business
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user