From b593a8149b0ee0bfabc03b5e205a41358d0a7c24 Mon Sep 17 00:00:00 2001 From: suseendhiran17 <58357088+suseendhiran17@users.noreply.github.com> Date: Tue, 2 Aug 2022 17:30:26 +0530 Subject: [PATCH] mainLandingPage Api : suseendhiran --- app/controllers/loan.details.controller.js | 5 +++-- app/services/ApiCallHelper.js | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/loan.details.controller.js b/app/controllers/loan.details.controller.js index 3d11e5b..77db583 100644 --- a/app/controllers/loan.details.controller.js +++ b/app/controllers/loan.details.controller.js @@ -14,7 +14,8 @@ exports.mainLandingPage = async (req, res) => ResData = await ApiCallHelper.loanDetailsDataApiCall(req.query.losid); if (ResData.status != 'Not Found') { - if (ResData.lstLoanApplication.length != 0) + Loan_Detail = LoanDetail.findAll({ where : { losid : req.query.losid , is_active : 1}}) + if (ResData.lstLoanApplication.length != 0 && Loan_Detail.length == undefined ) { loanDetailData = ResData.lstLoanApplication[0]; loanDetailObject = @@ -139,7 +140,7 @@ exports.mainLandingPage = async (req, res) => } else { - logMsg.info("Los api call failed Failed" +ResData.losid); + logMsg.info("Los api call failed Failed" + ResData.losid); } // Los api call failed diff --git a/app/services/ApiCallHelper.js b/app/services/ApiCallHelper.js index 6d0487e..92b94cb 100644 --- a/app/services/ApiCallHelper.js +++ b/app/services/ApiCallHelper.js @@ -191,7 +191,9 @@ async function EntityChildTable(EntityId) Promise.all([DueDiligenceCheckPromise, ATNWrelatedInputsPromise, OtherParametersPromise , TradeReferencesPromise , EnquiriesAndDisbursementsPromise ]) .then((values) => { - logMsg.info("Data Creation Success for EntityId= "+EntityId); // [3, 1337, "foo"] + values.forEach(element => { + logMsg.info(element+ "Data Creation Success for EntityId= "+EntityId); // [3, 1337, "foo"] + }); }) } @@ -205,7 +207,7 @@ async function EntityChildTable(EntityId) -function ApplicantChildTable(ApplicantName , LoanId , ApplicantId , Losid , EntityType , ApiArray , Product , Applicant_id) { +function ApplicantChildTable(ApplicantName , LoanId , ApplicantId , Losid , EntityType , ApiArray , Product , Applicant_id ) { try { // ApplicantsRelationship Table @@ -271,7 +273,9 @@ function ApplicantChildTable(ApplicantName , LoanId , ApplicantId , Losid , Enti Promise.all([ApplicantsRelationshipPromise, ResidenceAddressDetailsPromise, PropertyOwnershipIncomeConsideredPromise ]) .then((values) => { - logMsg.info("ApplicantsRelationshipPromise ,ResidenceAddressDetailsPromise, PropertyOwnershipIncomeConsidered inserted");; // [3, 1337, "foo"] + values.forEach(element => { + logMsg.info(element+ "Data Creation Success for EntityId= "+EntityId); // [3, 1337, "foo"] + }); })