21c0a7b59c
The /api/reports/clients endpoint was crashing with a 500 on every request because a raw JavaScript Date passed into a sql template literal in .having() cannot be serialized by postgres-js. The fix serializes it as an ISO string with an explicit ::timestamptz cast. Also adds reportsRouter.onError() and improves the frontend error message to surface which specific endpoint failed and why. Fixes #49 Co-Authored-By: Paperclip <noreply@paperclip.ing>