diff --git a/app/controllers/salespd.controller.js b/app/controllers/salespd.controller.js index e1c94f7..fb406e4 100644 --- a/app/controllers/salespd.controller.js +++ b/app/controllers/salespd.controller.js @@ -110,6 +110,15 @@ exports.PullSalesPdData = async (req, res) => }; + + + + + + + + + exports.PullSalesPdPhotographsData = async (req, res) => { try @@ -139,6 +148,17 @@ exports.PullSalesPdPhotographsData = async (req, res) => }; + + + + + + + + + + + exports.imageView = async (req, res) => { try @@ -153,6 +173,16 @@ exports.imageView = async (req, res) => } //end of try catch }; + + + + + + + + + + exports.DownloadPdReport = async (req, res) => { try @@ -166,9 +196,9 @@ exports.DownloadPdReport = async (req, res) => url: url, method: "GET" - }, function (error, response, body) { console.log(body); + }, function (error, response, body) { if (body != undefined) { - data = JSON.parse(body); + data = JSON.parse(body); if ( data.status == 200) { link = data.records; @@ -176,7 +206,10 @@ exports.DownloadPdReport = async (req, res) => }else{ res.send({'status':404,'message':"failed",'data':"No data"}); } - } + + }else{ + res.send({'status':404,'message':"failed",'data':"No data"}); + } }); @@ -232,12 +265,14 @@ exports.SectionList = async (req, res) => { try { - applicantDetails = await ApiCallHelper.MainApplicantDetails(req.query.losid); - MainApplicantDetails = JSON.parse(applicantDetails); - - if(MainApplicantDetails.status == 200) - { - GeneralSection.findAll({ where:{main_loan_applicant:MainApplicantDetails.data.name,is_active : 1}, + // applicantDetails = await ApiCallHelper.MainApplicantDetails(req.query.losid); + // MainApplicantDetails = JSON.parse(applicantDetails); + // if(MainApplicantDetails.status == 200) + // { + // main_loan_applicant = MainApplicantDetails.data.name; + + pdId = req.query.pd_id; + GeneralSection.findAll({ where:{ref_no:pdId,is_active : 1}, include: [ {model: FundRequirement }, {model: DetailsOfKeyShareHolder }, {model: FinancialInformation }, {model: FinalRemarks }, {model: BriefOfBusiness }, {model: PropertyInformation }, {model: OfficerDetails }, {model: Photograph }] }) .then(data => { @@ -280,11 +315,11 @@ exports.SectionList = async (req, res) => res.send({'status':404,message: err.message || "Some error occurred while retrieving data" ,'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) { diff --git a/app/models/GeneralSection.js b/app/models/GeneralSection.js index 67cd458..69d0420 100644 --- a/app/models/GeneralSection.js +++ b/app/models/GeneralSection.js @@ -33,6 +33,7 @@ module.exports = (sequelize, DataTypes) => { current_residence_address: { type: DataTypes.STRING }, current_residence_ownership: { type: DataTypes.STRING }, business_office_address: { type: DataTypes.STRING }, + remarks: { type: DataTypes.STRING }, createdby: { type: DataTypes.INTEGER }, updatedby: { type: DataTypes.INTEGER }