fix: invert backend sorting to make new payloads appear first and fix group sorting
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 51s

This commit is contained in:
Cauê Faleiros
2026-05-06 11:09:25 -03:00
parent 41a1afc0e5
commit cf3f79b3da
2 changed files with 3 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ const formatRow = (row) => ({
// GET data (for the frontend)
app.get('/api/data', verifyToken, async (req, res) => {
try {
const result = await pool.query('SELECT * FROM orders ORDER BY id ASC');
const result = await pool.query('SELECT * FROM orders ORDER BY id DESC');
const formattedData = result.rows.map(formatRow);
res.json(formattedData);
} catch (error) {