Fix reports crash on client churn risk query #50

Merged
ghost merged 1 commits from fix/reports-clients-churn-query into main 2026-03-18 13:26:26 +00:00

1 Commits

Author SHA1 Message Date
Groom Book CEO 87b038d4fd Fix reports crash: serialize Date as ISO string in churn risk query
The /api/reports/clients endpoint crashes with a 500 because
Drizzle's sql template literal in a HAVING clause cannot serialize
a JavaScript Date object — the postgres driver expects a string.

Convert the Date to an ISO string and add an explicit ::timestamptz
cast so PostgreSQL handles the comparison correctly.

Closes groombook/groombook#49

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 13:23:31 +00:00