From aac1936f471831538ff00f35dbcdbc70fe7c1a82 Mon Sep 17 00:00:00 2001 From: sriramv Date: Mon, 2 May 2022 11:56:55 +0530 Subject: [PATCH] gwm --- app/controllers/salespd.controller.js | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/app/controllers/salespd.controller.js b/app/controllers/salespd.controller.js index f04b0ee..71a81a6 100644 --- a/app/controllers/salespd.controller.js +++ b/app/controllers/salespd.controller.js @@ -15,12 +15,38 @@ exports.SectionList = async (req, res) => if(MainApplicantDetails.status == 200) { GeneralSection.findAll({ where:{losid:req.query.losid,main_loan_applicant:MainApplicantDetails.data.name,is_active : 1}, - include: [ {model: FundRequirement }, {model: DetailsOfKeyShareHolder }, {model: DetailsOfKeyShareHolder }, {model: BreifOfBusiness }, {model: FinancialInformation }, {model: PropertyInformation }, {model: FinalRemarks }, {model: OfficerDetails }, {model: Photograph }, {model: InstitutionDetail }, {model: ProductInformation }] }) + include: [ {model: FundRequirement }, {model: DetailsOfKeyShareHolder }, {model: FinancialInformation }, {model: FinalRemarks }, {model: BreifOfBusiness }, {model: PropertyInformation }, {model: OfficerDetails }, {model: Photograph }, {model: InstitutionDetail }, {model: ProductInformation }] }) .then(data => { + section_name_obj = { + section1_key : "GeneralSection" , + section1_name : "General Section" , + section2_key : "FundRequirement", + section2_name : "Fund Requirement", + section3_key : "DetailsOfKeyShareHolder", + section3_name : "Details Of Key ShareHolder", + section4_key : "BreifOfBusiness", + section4_name : "Breif Of Business", + section5_key : "FinancialInformation", + section5_name : "Financial Information", + section6_key : "PropertyInformation", + section6_name : "Property Information", + section7_key : "FinalRemarks", + section7_name : "Final Remarks", + section8_key : "OfficerDetails", + section8_name : "Officer Details", + section9_key : "Photograph", + section9_name : "Photograph", + section10_key : "InstitutionDetail", + section10_name : "Institution Detail", + section11_key : "ProductInformation", + section11_name : "Product Information", + }; + if(data.length > 0) { - res.send({'status':200,'message':"success",'data':data}); + res_data = {data : data , section_names : section_name_obj} + res.send({'status':200,'message':"success",'data':res_data}); } else { res.send({'status':404,'message':"failed",'data':"No data"});