diff --git a/app/controllers/creditpd.controller.js b/app/controllers/creditpd.controller.js index d0803c9..5cf90c9 100644 --- a/app/controllers/creditpd.controller.js +++ b/app/controllers/creditpd.controller.js @@ -65,7 +65,7 @@ exports.PullCreditPdData = async (req, res) => { Object.assign(obj , {pd_id : PDID.dataValues.pd_id} ); var index = table_name[0].table_name; var tableName = arr[index]; - tableName.create(obj);logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id); + await tableName.create(obj);logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id); } } res.send({'status':200,'message':"success"}); @@ -248,43 +248,43 @@ exports.GetCreditPdData = async (req, res) => // { // try // { - // applicantDetails = await Credit_PdHelper.MainApplicantDetails(req.query.losid); - // MainApplicantDetails = JSON.parse(applicantDetails); - // if(MainApplicantDetails.status == 200) - // { - // CreditGeneralInformation.findAll({ where : { pd_id :409,is_active : 1}, - // include : [ - // {model: CreditAddressDetail }, {model: CreditFuturePlans }, - // {model : CreditBorrowerAndGuarantorDetails }, - // {model: CreditBusinessAndPersonalBankingDetails }, {model: BusinessAsset }, - // {model: CreditFinancialInformation }, {model: CreditKeyShareholder }, - // {model: CreditKeyProductBusinessContribution }, {model: EmployeeStrength }, - // {model: ClientDetail }, {model: StockDetail }, - // {model: CreditExistingLoanObligation }, - // {model: FamilyMemberInvolvedInBusiness }, - // {model : CreditManager }, - // {model: Photograph }, - // {model: CreditFinalRemarks }, {model: CreditLoanDetail }, - // {model: CreditGeneralBusinessInformation }, - // {model: SupplierDetail } - // ] - // }) - // .then((data)=>{ - // if (data.length > 0) - // { - // res.send({'status':200,'message':"success",'data':data}); - // } - // else - // { - // res.send({'status':404,'message':"failed",'data':"No data"}); - // } - // }) +// // applicantDetails = await Credit_PdHelper.MainApplicantDetails(req.query.losid); +// // MainApplicantDetails = JSON.parse(applicantDetails); +// // if(MainApplicantDetails.status == 200) +// // { +// CreditGeneralInformation.findAll({ where : { pd_id :410,is_active : 1}, +// include : [ +// {model: CreditAddressDetail }, {model: CreditFuturePlans }, +// {model : CreditBorrowerAndGuarantorDetails }, +// {model: CreditBusinessAndPersonalBankingDetails }, {model: BusinessAsset }, +// {model: CreditFinancialInformation }, {model: CreditKeyShareholder }, +// {model: CreditKeyProductBusinessContribution }, {model: EmployeeStrength }, +// {model: ClientDetail }, {model: StockDetail }, +// {model: CreditExistingLoanObligation }, +// {model: FamilyMemberInvolvedInBusiness }, +// {model : CreditManager }, +// {model: Photograph }, +// {model: CreditFinalRemarks }, {model: CreditLoanDetail }, +// {model: CreditGeneralBusinessInformation }, +// {model: SupplierDetail } +// ] +// }) +// .then((data)=>{ +// if (data.length > 0) +// { +// res.send({'status':200,'message':"success",'data':data}); +// } +// else +// { +// res.send({'status':404,'message':"failed",'data':"No data"}); +// } +// }) - // } - // else - // { - // res.send({'status':404,'message':"failed",'data':"No data"}); - // } +// // } +// // else +// // { +// // res.send({'status':404,'message':"failed",'data':"No data"}); +// // } // } catch(err) { // res.status(500).send({'status':404,