diff --git a/app/controllers/loan.details.controller.js b/app/controllers/loan.details.controller.js index 4ccbb90..44925a4 100644 --- a/app/controllers/loan.details.controller.js +++ b/app/controllers/loan.details.controller.js @@ -19,7 +19,7 @@ exports.mainLandingPage = async (req, res) => include: [{ model: ApplicantsDetails , // Set the alias for the relationship attributes: [ [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column - ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data => + ] , limit: 1 }] }).then(data => { if(data.length > 0) { @@ -63,7 +63,7 @@ exports.mainLandingPage = async (req, res) => include: [{ model: ApplicantsDetails , // Set the alias for the relationship attributes: [ [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column - ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } }) + ] , 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"}); } }) // Entity detail promise var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) => @@ -182,7 +182,7 @@ exports.mainLandingPage = async (req, res) => include: [{ model: ApplicantsDetails , // Set the alias for the relationship attributes: [ [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column - ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data => + ] , limit: 1 }] }).then(data => { if(data.length > 0) { @@ -206,7 +206,7 @@ exports.mainLandingPage = async (req, res) => include: [{ model: ApplicantsDetails , // Set the alias for the relationship attributes: [ [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column - ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data => + ] , limit: 1 }] }).then(data => { if(data.length > 0) {