GWM
This commit is contained in:
parent
d6d3fe500d
commit
73d27436bc
@ -167,23 +167,16 @@ exports.PullSalesPdPhotographsData = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// fetch SMC PdId from DB
|
||||
GeneralSectionData = await GeneralSection.findOne({ where : { ref_no : req.body.pdid ,case_no :req.body.caseno, is_active : 1 }});
|
||||
GeneralSectionData = await GeneralSection.findOne({ where : { ref_no : req.body.pdid ,case_no :req.body.caseno, is_active : 1 }});
|
||||
PdId = GeneralSectionData.dataValues.pd_id;
|
||||
// convert image file to base64 code
|
||||
// path = "storage/uploads/"
|
||||
// file = path+img_name;
|
||||
// base64_data = "data:image/png;base64," + fs.readFileSync(file, 'base64');
|
||||
// insert photograph data here
|
||||
|
||||
|
||||
await Photograph.create({pd_id: PdId , ref_no :req.body.pdid , img_name :req.body.img_name , img : img_name})
|
||||
.then((successData)=>{logMsg.info("Photograph insert success ,PdId= "+PdId);})
|
||||
.catch((err)=>{ logMsg.info("Photograph insert failed ,PdId= "+PdId+" ERROR : "+err);});
|
||||
// responce to FE
|
||||
setTimeout(() => {
|
||||
.then((successData)=>{
|
||||
logMsg.info("Photograph insert success ,PdId= "+PdId);
|
||||
res.send({'status':200,'message':"success",'data':"No data"});
|
||||
}, 300);
|
||||
|
||||
}).catch((err)=>{ logMsg.info("Photograph insert failed ,PdId= "+PdId+" ERROR : "+err);});
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,message: err.message || "Some error occurred while retrieving data." ,'data': "No data" });
|
||||
|
||||
@ -4,7 +4,7 @@ const request = require('request');
|
||||
|
||||
function MainApplicantDetails(losid) {
|
||||
try {
|
||||
const url = "https://demo.devopsmcfinance.com/cet_mainapp/api/MainApplicantDetailsList?losid="+losid;
|
||||
const url = process.env.MAIN_APPLICANT_DETAILS+"MainApplicantDetailsList?losid="+losid;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
|
||||
@ -2,6 +2,7 @@ require('dotenv').config();
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const bodyParser = require('body-parser');
|
||||
|
||||
//it is used to clear cache
|
||||
app.use(function(req, res, next) {
|
||||
res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 126 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Loading…
Reference in New Issue
Block a user