Initial commit: SIBU 2.0 MISSION
This commit is contained in:
27
frontend/src/services/taxisService.ts
Normal file
27
frontend/src/services/taxisService.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/** Service for taxi-related API calls */
|
||||
import { apiClient } from './apiClient'
|
||||
import type { Taxi } from '@/types'
|
||||
|
||||
export interface TaxiFilters {
|
||||
corregimiento?: string
|
||||
shift?: string
|
||||
english_speaking?: boolean
|
||||
is_active?: boolean
|
||||
}
|
||||
|
||||
export const taxisService = {
|
||||
/** Get all taxis with optional filters */
|
||||
async getAllTaxis(filters?: TaxiFilters): Promise<Taxi[]> {
|
||||
const response = await apiClient.get<Taxi[]>('/api/taxis', {
|
||||
params: filters,
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
/** Get a single taxi by ID */
|
||||
async getTaxiById(id: string): Promise<Taxi> {
|
||||
const response = await apiClient.get<Taxi>(`/api/taxis/${id}`)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user