From 9757731cb025ddbf094c16d48b5f5a1c37e28785 Mon Sep 17 00:00:00 2001 From: sriramv Date: Thu, 27 Jul 2023 17:50:55 +0530 Subject: [PATCH] loanApiIntegration:GWM --- app/controllers/cibil.controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/cibil.controller.js b/app/controllers/cibil.controller.js index e7e3b59..5d70b7c 100644 --- a/app/controllers/cibil.controller.js +++ b/app/controllers/cibil.controller.js @@ -739,11 +739,11 @@ exports.LandingPageDetailsList = async (req, res) => ResData.lstApplicantKYCDetail.forEach(async(value,index,array) => { if (value.kycType.trim() == "Non-Individual") { - lstEntityKYCDetailObj = { losid:req.query.losid, pan_no : value.panNo,entity_type : value.kycType.trim() } + lstEntityKYCDetailObj = { losid:req.query.losid, PAN : value.panNo,entity_type : value.kycType.trim() } await PanList.push(lstEntityKYCDetailObj); } else if (value.kycType.trim() == "Individual") { - lstApplicantKYCDetailObj = { losid:req.query.losid, pan_no : value.panNo,entity_type : value.kycType.trim(),} + lstApplicantKYCDetailObj = { losid:req.query.losid, PAN : value.panNo,entity_type : value.kycType.trim(),} await PanList.push(lstApplicantKYCDetailObj); } }); @@ -753,6 +753,7 @@ exports.LandingPageDetailsList = async (req, res) => if(PanList.length != 0) { + console.log(PanList); var CibilDataInsert = new Promise(async(resolve, reject) => { PanList.forEach(async(PanListValue,PanListIndex,PanListArray) => { @@ -760,7 +761,7 @@ exports.LandingPageDetailsList = async (req, res) => if(PanListValue.entity_type == "Individual"){ CibilType = 1; }else if(PanListValue.entity_type == "Non-Individual"){CibilType = 2;} await Object.assign(PanListValue, {cibil_type:CibilType}) - BorrowerDetailData = await InBorrowerDetail.findOne({where:{losid:PanListValue.losid , PAN:PanListValue.pan_no ,cibil_type:CibilType}}); + BorrowerDetailData = await InBorrowerDetail.findOne({where:{losid:PanListValue.losid , PAN:PanListValue.PAN ,cibil_type:CibilType}}); if(BorrowerDetailData) { //skip data insertion for this case @@ -771,6 +772,7 @@ exports.LandingPageDetailsList = async (req, res) => { //create Intermediate table borrower details (only losid,pan,cibil_type,entity_type) await InBorrowerDetail.create(PanListValue).then(async(PanListData)=>{ + console.log(PanListData); //call cibil data api and insert cibil data in to input tables if(PanListData.cibil_type == 1) {