fix: convert DECIMAL columns to numbers in fuel logs API (refs #49)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 4m50s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 38s
Deploy to Staging / Verify Staging (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped

PostgreSQL DECIMAL columns return as strings from pg driver.
- Add Number() conversion for fuelUnits and costPerUnit in toEnhancedResponse()
- Add query invalidation for 'all' key to fix dynamic updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-17 22:37:59 -06:00
parent 33c88e7591
commit 5c62b6ac96
2 changed files with 3 additions and 2 deletions

View File

@@ -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] });
},
});