fix(backend): Parse bigint values in heatmap API response

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 <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-09 08:45:05 -07:00
parent 3fa22a6ba1
commit ecc201e9d4

View File

@@ -823,7 +823,13 @@ export class StateQueryService {
} }
const result = await this.pool.query(query, params); 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,
}));
} }
/** /**