From 7951787b166b297744eea5d2eab1bc4103364187 Mon Sep 17 00:00:00 2001 From: Sidney Date: Sun, 31 May 2026 18:07:07 -0300 Subject: [PATCH] fix: resolve ambiguous order by vencimento error in portal financial and boletos endpoints --- portal/server.selfhosted.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] );