Fix: use SELECT * in Portal financial query to prevent column-not-found crash before Phase 1 migration runs
This commit is contained in:
parent
ce82f30598
commit
7bada2a4e7
|
|
@ -229,10 +229,9 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => {
|
||||||
let dbRows = [];
|
let dbRows = [];
|
||||||
try {
|
try {
|
||||||
const { rows } = await pool.query(
|
const { rows } = await pool.query(
|
||||||
`SELECT asaas_payment_id, asaas_installment_id, installment,
|
`SELECT *,
|
||||||
valor, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento,
|
TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento,
|
||||||
status, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento,
|
TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento
|
||||||
link_boleto, link_carne, transaction_receipt_url
|
|
||||||
FROM alunos_cobrancas
|
FROM alunos_cobrancas
|
||||||
WHERE aluno_id = $1
|
WHERE aluno_id = $1
|
||||||
ORDER BY vencimento ASC`,
|
ORDER BY vencimento ASC`,
|
||||||
|
|
|
||||||
|
|
@ -229,12 +229,9 @@ app.get('/api/portal/financeiro', authMiddleware, async (req, res) => {
|
||||||
let dbRows = [];
|
let dbRows = [];
|
||||||
try {
|
try {
|
||||||
const { rows } = await pool.query(
|
const { rows } = await pool.query(
|
||||||
`SELECT asaas_payment_id, asaas_installment_id, installment,
|
`SELECT *,
|
||||||
valor, TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento,
|
TO_CHAR(vencimento, 'YYYY-MM-DD') as vencimento,
|
||||||
status, TO_CHAR(data_pagamento, 'YYYY-MM-DD') as data_pagamento,
|
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
|
|
||||||
FROM alunos_cobrancas
|
FROM alunos_cobrancas
|
||||||
WHERE aluno_id = $1
|
WHERE aluno_id = $1
|
||||||
ORDER BY vencimento ASC`,
|
ORDER BY vencimento ASC`,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue