Fix Auth Errors

This commit is contained in:
Eric Gullickson
2025-09-22 10:27:10 -05:00
parent 3588372cef
commit 8fd7973656
19 changed files with 1342 additions and 174 deletions

View File

@@ -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;
}
};