fix: added beneficiary create date in beneficiary list payload
This commit is contained in:
@@ -53,13 +53,14 @@ async function deleteBeneficiary(customerNo, beneficiaryAccountNo) {
|
|||||||
|
|
||||||
async function getAllBeneficiaries(customerNo) {
|
async function getAllBeneficiaries(customerNo) {
|
||||||
const queryStr =
|
const queryStr =
|
||||||
'SELECT b.account_no, b.name, b.account_type, b.ifsc_code, i.bank_name, i.branch_name FROM beneficiaries b JOIN LATERAL( SELECT * FROM ifsc_details i WHERE i.ifsc_code = b.ifsc_code LIMIT 1 ) i ON true WHERE customer_no = $1';
|
'SELECT b.account_no, b.name, b.account_type, b.ifsc_code, b.created_at, i.bank_name, i.branch_name FROM beneficiaries b JOIN LATERAL( SELECT * FROM ifsc_details i WHERE i.ifsc_code = b.ifsc_code LIMIT 1 ) i ON true WHERE customer_no = $1';
|
||||||
const result = await db.query(queryStr, [customerNo]);
|
const result = await db.query(queryStr, [customerNo]);
|
||||||
const list = result.rows.map((row) => {
|
const list = result.rows.map((row) => {
|
||||||
const details = {
|
const details = {
|
||||||
accountNo: row['account_no'],
|
accountNo: row['account_no'],
|
||||||
name: row['name'],
|
name: row['name'],
|
||||||
accountType: row['account_type'],
|
accountType: row['account_type'],
|
||||||
|
createdAt: row['created_at'],
|
||||||
};
|
};
|
||||||
if (row['ifsc_code'] === '_') {
|
if (row['ifsc_code'] === '_') {
|
||||||
details['bankName'] = 'THE KANGRA CENTRAL COOPERATIVE BANK LIMITED';
|
details['bankName'] = 'THE KANGRA CENTRAL COOPERATIVE BANK LIMITED';
|
||||||
|
|||||||
Reference in New Issue
Block a user