From ecc201e9d4993aee68c8fabc68e444eb268fc18c Mon Sep 17 00:00:00 2001 From: Kelly Date: Tue, 9 Dec 2025 08:45:05 -0700 Subject: [PATCH] fix(backend): Parse bigint values in heatmap API response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL returns bigint columns as strings. The heatmap API was returning these raw strings, causing string concatenation instead of numeric addition in the frontend when summing values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/src/multi-state/state-query-service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/multi-state/state-query-service.ts b/backend/src/multi-state/state-query-service.ts index a48dcf3b..120cce6e 100644 --- a/backend/src/multi-state/state-query-service.ts +++ b/backend/src/multi-state/state-query-service.ts @@ -823,7 +823,13 @@ export class StateQueryService { } const result = await this.pool.query(query, params); - return result.rows; + // Parse numeric values from strings (PostgreSQL returns bigint as string) + return result.rows.map((row: any) => ({ + state: row.state, + stateName: row.stateName, + value: row.value !== null ? parseFloat(row.value) : 0, + label: row.label, + })); } /**