diff --git a/portal/server.selfhosted.js b/portal/server.selfhosted.js index 9200a7b..4049876 100644 --- a/portal/server.selfhosted.js +++ b/portal/server.selfhosted.js @@ -308,7 +308,7 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => { TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento FROM alunos_cobrancas WHERE aluno_id = $1 - ORDER BY vencimento ASC`, + ORDER BY alunos_cobrancas.vencimento ASC`, [req.user.studentId] ); dbRows = rows || []; @@ -388,7 +388,7 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => { app.get('/api/portal/boletos', authMiddleware, async (req, res) => { try { const { rows } = await pool.query( - `SELECT *, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento FROM alunos_cobrancas WHERE aluno_id = $1 ORDER BY vencimento ASC`, + `SELECT *, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento FROM alunos_cobrancas WHERE aluno_id = $1 ORDER BY alunos_cobrancas.vencimento ASC`, [req.user.studentId] );