GWM
This commit is contained in:
parent
d6d3fe500d
commit
73d27436bc
@ -167,23 +167,16 @@ exports.PullSalesPdPhotographsData = async (req, res) =>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
// fetch SMC PdId from DB
|
// 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;
|
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})
|
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);})
|
.then((successData)=>{
|
||||||
.catch((err)=>{ logMsg.info("Photograph insert failed ,PdId= "+PdId+" ERROR : "+err);});
|
logMsg.info("Photograph insert success ,PdId= "+PdId);
|
||||||
// responce to FE
|
|
||||||
setTimeout(() => {
|
|
||||||
res.send({'status':200,'message':"success",'data':"No data"});
|
res.send({'status':200,'message':"success",'data':"No data"});
|
||||||
}, 300);
|
}).catch((err)=>{ logMsg.info("Photograph insert failed ,PdId= "+PdId+" ERROR : "+err);});
|
||||||
|
|
||||||
|
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
res.send({'status':404,message: err.message || "Some error occurred while retrieving data." ,'data': "No data" });
|
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) {
|
function MainApplicantDetails(losid) {
|
||||||
try {
|
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) => {
|
return new Promise((resolve, reject) => {
|
||||||
request({
|
request({
|
||||||
|
|||||||
@ -2,6 +2,7 @@ require('dotenv').config();
|
|||||||
const express = require('express')
|
const express = require('express')
|
||||||
const app = express()
|
const app = express()
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
|
|
||||||
//it is used to clear cache
|
//it is used to clear cache
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0")
|
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