From 7bada2a4e7d09416b8adcb8787c991c0764a48f3 Mon Sep 17 00:00:00 2001 From: Sidney Date: Thu, 14 May 2026 21:54:48 -0300 Subject: [PATCH] Fix: use SELECT * in Portal financial query to prevent column-not-found crash before Phase 1 migration runs --- portal/server.js | 7 +++---- portal/server.selfhosted.js | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/portal/server.js b/portal/server.js index 0a54f06..1b0b7f6 100644 --- a/portal/server.js +++ b/portal/server.js @@ -229,10 +229,9 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => { let dbRows = []; try { const { rows } = await pool.query( - `SELECT asaas_payment_id, asaas_installment_id, installment, - valor, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento, - status, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento, - link_boleto, link_carne, transaction_receipt_url + `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`, diff --git a/portal/server.selfhosted.js b/portal/server.selfhosted.js index 51b0f5b..2987d58 100644 --- a/portal/server.selfhosted.js +++ b/portal/server.selfhosted.js @@ -229,12 +229,9 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => { let dbRows = []; try { const { rows } = await pool.query( - `SELECT asaas_payment_id, asaas_installment_id, installment, - valor, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento, - status, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento, - link_boleto, link_carne, transaction_receipt_url, - description, type, discount, installment_number, total_installments, - contract_id, asaas_payment_url, amount_original + `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`,