This commit is contained in:
suseendhiran17 2023-08-10 14:50:00 +05:30
parent d7b8b96f8f
commit 68a06b6451

View File

@ -19,7 +19,7 @@ exports.mainLandingPage = async (req, res) =>
include: [{ model: ApplicantsDetails , // Set the alias for the relationship include: [{ model: ApplicantsDetails , // Set the alias for the relationship
attributes: [ attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , limit: 1 , order: [['createdAt', 'DESC']] }] }).then(data => ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
{ {
if(data.length > 0) if(data.length > 0)
{ {
@ -63,7 +63,7 @@ exports.mainLandingPage = async (req, res) =>
include: [{ model: ApplicantsDetails , // Set the alias for the relationship include: [{ model: ApplicantsDetails , // Set the alias for the relationship
attributes: [ attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column [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"}); } }) ] , 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"}); } })
// Entity detail promise // Entity detail promise
var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) => var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) =>
@ -150,6 +150,7 @@ exports.mainLandingPage = async (req, res) =>
name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "), // concat and ignore null name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "), // concat and ignore null
pan_no : value.panNo, pan_no : value.panNo,
entity_type : value.kycType.trim(), entity_type : value.kycType.trim(),
applicant_type : 'Main Applicant'
} }
lstApplicantKYCDetailDataArray.push(lstApplicantKYCDetailObj); lstApplicantKYCDetailDataArray.push(lstApplicantKYCDetailObj);
} }
@ -181,7 +182,7 @@ exports.mainLandingPage = async (req, res) =>
include: [{ model: ApplicantsDetails , // Set the alias for the relationship include: [{ model: ApplicantsDetails , // Set the alias for the relationship
attributes: [ attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , limit: 1 }] }).then(data => ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
{ {
if(data.length > 0) if(data.length > 0)
{ {
@ -205,7 +206,7 @@ exports.mainLandingPage = async (req, res) =>
include: [{ model: ApplicantsDetails , // Set the alias for the relationship include: [{ model: ApplicantsDetails , // Set the alias for the relationship
attributes: [ attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column [sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , limit: 1 }]}).then(data => ] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
{ {
if(data.length > 0) if(data.length > 0)
{ {