From eb6dd5dff7ddde671e9981d83544c6e9c24366d8 Mon Sep 17 00:00:00 2001 From: sriramv Date: Fri, 11 Aug 2023 11:05:03 +0530 Subject: [PATCH] vvvw --- app/controllers/loan.details.controller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {