Fix Auth Errors
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { apiClient } from '../../../core/api/client';
|
||||
import { CreateFuelLogRequest, FuelLogResponse, EnhancedFuelStats, FuelType, FuelGradeOption } from '../types/fuel-logs.types';
|
||||
import { CreateFuelLogRequest, UpdateFuelLogRequest, FuelLogResponse, EnhancedFuelStats, FuelType, FuelGradeOption } from '../types/fuel-logs.types';
|
||||
|
||||
export const fuelLogsApi = {
|
||||
async create(data: CreateFuelLogRequest): Promise<FuelLogResponse> {
|
||||
@@ -30,6 +30,20 @@ export const fuelLogsApi = {
|
||||
async getFuelGrades(fuelType: FuelType): Promise<FuelGradeOption[]> {
|
||||
const res = await apiClient.get(`/fuel-logs/fuel-grades/${fuelType}`);
|
||||
return res.data.grades;
|
||||
},
|
||||
|
||||
async update(id: string, data: UpdateFuelLogRequest): Promise<FuelLogResponse> {
|
||||
const res = await apiClient.put(`/fuel-logs/${id}`, data);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async delete(id: string): Promise<void> {
|
||||
await apiClient.delete(`/fuel-logs/${id}`);
|
||||
},
|
||||
|
||||
async getById(id: string): Promise<FuelLogResponse> {
|
||||
const res = await apiClient.get(`/fuel-logs/${id}`);
|
||||
return res.data;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user