cast to percentage
This commit is contained in:
@@ -13,7 +13,7 @@ function camelToSnake(str: string): string {
|
|||||||
router.get('/', async (req, res) => {
|
router.get('/', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const result = await pool.query(
|
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]
|
[req.user!.id]
|
||||||
);
|
);
|
||||||
// Map snake_case columns back to camelCase for the frontend
|
// Map snake_case columns back to camelCase for the frontend
|
||||||
|
|||||||
Reference in New Issue
Block a user