From d7b8b96f8f13b17862e3807f05e7992e0b2c268e Mon Sep 17 00:00:00 2001 From: suseendhiran17 <58357088+suseendhiran17@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:31:50 +0530 Subject: [PATCH] susee --- app/controllers/loan.details.controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/loan.details.controller.js b/app/controllers/loan.details.controller.js index ecfa392..03b9bd7 100644 --- a/app/controllers/loan.details.controller.js +++ b/app/controllers/loan.details.controller.js @@ -59,7 +59,11 @@ exports.mainLandingPage = async (req, res) => //Module Wise Completion Status Data Creation Helper Call ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo); // Final Response - LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1}}).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } }) + LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1}, + include: [{ model: ApplicantsDetails , // Set the alias for the relationship + attributes: [ + [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column + ] , limit: 1 , order: [['createdAt', 'DESC']] }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } }) // Entity detail promise var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) =>