From 5175982cbff44b203a933b9aa7d346c1a22f6bbf Mon Sep 17 00:00:00 2001 From: sriramv Date: Fri, 11 Aug 2023 11:13:15 +0530 Subject: [PATCH] vvvw --- app/controllers/loan.details.controller.js | 26 +++++----------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/app/controllers/loan.details.controller.js b/app/controllers/loan.details.controller.js index 44925a4..09c3155 100644 --- a/app/controllers/loan.details.controller.js +++ b/app/controllers/loan.details.controller.js @@ -15,13 +15,9 @@ exports.mainLandingPage = async (req, res) => if(req.query.is_loan_api_call == 0) { - 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 }] }).then(data => + LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1} }).then(data => { - if(data.length > 0) + if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } @@ -59,11 +55,7 @@ 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}, - include: [{ model: ApplicantsDetails , // Set the alias for the relationship - attributes: [ - [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column - ] , limit: 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} }).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) => @@ -178,11 +170,7 @@ exports.mainLandingPage = async (req, res) => else { logMsg.info("Los api call Failed " +req.query.losid); - 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 }] }).then(data => + LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1} }).then(data => { if(data.length > 0) { @@ -202,11 +190,7 @@ exports.mainLandingPage = async (req, res) => { logMsg.info("Data already inserted " +req.query.losid); // Final Response - 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 }] }).then(data => + LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1} }).then(data => { if(data.length > 0) {