diff --git a/app/controllers/creditpd.controller.js b/app/controllers/creditpd.controller.js index ea26c0a..e2a8602 100644 --- a/app/controllers/creditpd.controller.js +++ b/app/controllers/creditpd.controller.js @@ -44,7 +44,7 @@ exports.PullCreditPdData = async (req, res) => { } console.log(completed_date); // create creditGeneralInormationData - Object.assign(obj, { ref_no: tempData.pdid , product : tempData.product , case_no : tempData.caseno , credit_pd_type : req.body.credit_pd_type , completed_date : completed_date , applicant_id :req.body.lender_applicant_id , location : req.body.start_location}); + Object.assign(obj, { ref_no: tempData.pdid ,name:tempData.name, product : tempData.product , case_no : tempData.caseno , credit_pd_type : req.body.credit_pd_type , completed_date : completed_date , applicant_id :req.body.lender_applicant_id , location : req.body.start_location}); await CreditGeneralInformation.create(obj) .then((successData)=>{logMsg.info("GeneralInformation insert success ,PdId= "+successData.dataValues.pd_id);}) diff --git a/app/services/CreditPdHelper.js b/app/services/CreditPdHelper.js index 648369a..722c525 100644 --- a/app/services/CreditPdHelper.js +++ b/app/services/CreditPdHelper.js @@ -92,10 +92,8 @@ async function ARRAY(Array , GenInfoObj , OverallKey) { if (typeof Value === "object" && ( Value !== null )) { Obj = await OBJECT( element, Key , Value ); Object.assign(ArrayObj, Obj ) - if (OverallKey == "Borrower & Guarantor Details" && Key == "borrower_name" && ( element.borrower_type == "Main Applicant" || element.entity_type !== "Individual") ) { Object.assign(GenInfoObj,{name : element.borrower_name}); } } else { Object.assign(ArrayObj,{ [Key] : Value }) - if (OverallKey == "Borrower & Guarantor Details" && Key == "borrower_name" && ( element.borrower_type == "Main Applicant" || element.entity_type !== "Individual") ) { Object.assign(GenInfoObj,{name : element.borrower_name}); } } if (OverallKey == "Borrower & Guarantor Details" && Key == "numbers_of_years_business_running" ) {