diff --git a/backend/src/features/fuel-logs/domain/fuel-logs.service.ts b/backend/src/features/fuel-logs/domain/fuel-logs.service.ts index bb28d0d..1b70350 100644 --- a/backend/src/features/fuel-logs/domain/fuel-logs.service.ts +++ b/backend/src/features/fuel-logs/domain/fuel-logs.service.ts @@ -282,8 +282,8 @@ export class FuelLogsService { tripDistance: row.trip_distance ?? undefined, fuelType: row.fuel_type as FuelType, fuelGrade: row.fuel_grade ?? undefined, - fuelUnits: row.fuel_units, - costPerUnit: row.cost_per_unit, + fuelUnits: Number(row.fuel_units), + costPerUnit: Number(row.cost_per_unit), totalCost: Number(row.total_cost), locationData: row.location_data ?? undefined, notes: row.notes ?? undefined, diff --git a/frontend/src/features/fuel-logs/hooks/useFuelLogs.tsx b/frontend/src/features/fuel-logs/hooks/useFuelLogs.tsx index b9a0a02..1238811 100644 --- a/frontend/src/features/fuel-logs/hooks/useFuelLogs.tsx +++ b/frontend/src/features/fuel-logs/hooks/useFuelLogs.tsx @@ -45,6 +45,7 @@ export const useFuelLogs = (vehicleId?: string) => { mutationFn: (data: CreateFuelLogRequest) => fuelLogsApi.create(data), onSuccess: (_res, variables) => { queryClient.invalidateQueries({ queryKey: ['fuelLogs', variables.vehicleId] }); + queryClient.invalidateQueries({ queryKey: ['fuelLogs', 'all'] }); queryClient.invalidateQueries({ queryKey: ['fuelLogsStats', variables.vehicleId] }); }, });