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:
@@ -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,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user