cast to percentage

This commit is contained in:
2026-03-20 02:38:33 -05:00
parent c01d0ba005
commit e078c9aa7a

View File

@@ -13,7 +13,7 @@ function camelToSnake(str: string): string {
router.get('/', async (req, res) => {
try {
const result = await pool.query(
'SELECT * FROM chemicals WHERE user_id = $1 ORDER BY created_at DESC',
'SELECT *, percentage_full::float AS percentage_full FROM chemicals WHERE user_id = $1 ORDER BY created_at DESC',
[req.user!.id]
);
// Map snake_case columns back to camelCase for the frontend