This commit is contained in:
sriramv 2023-02-09 17:39:51 +05:30
parent 84066becf7
commit ccd04b0d35
2 changed files with 11 additions and 20 deletions

View File

@ -70,10 +70,13 @@ exports.MenuList = async (req, res) => {
redirectionApi.then(function(redirectionApiData){
if(redirectionApiData == false)
{
resolve();
logMsg.info("Redirection api data fetching failed for losid = "+losid);
}
else
{
logMsg.info("Redirection api data fetched successfully for losid = "+losid);
// insert pro42data into entities table using using foreach
redirectionApiData.forEach((Pro42Datavalue, key,array)=>{
@ -90,7 +93,7 @@ exports.MenuList = async (req, res) => {
Entities.create({ "losid":Pro42Datavalue.loginNo,"pan":Pro42Datavalue.pan,"cin":cin_number,"bizname":Pro42Datavalue.entityName,"entity_type":Pro42Datavalue.entityType,"probe42_data_status":1,"is_verified":0,"createdby":Pro42Datavalue.createdby})
.then(Entitydata => {
logMsg.info("entity created , data:"+Entitydata);
const cin = Entitydata.dataValues.cin;
if(cin != "")
{
@ -163,6 +166,7 @@ exports.MenuList = async (req, res) => {
} else {
// resolve here
if (key === array.length -1) { resolve(); }
logMsg.info("CIN no not exist for losid = "+losid+" and entity name ="+Entitydata.dataValues.bizname);
}
@ -179,7 +183,10 @@ exports.MenuList = async (req, res) => {
}); // end of Redirection api data foreach
} // end of redirectionApiData else condition
}) // end of Redirection api call
} else { resolve(); }
} else {
resolve();
logMsg.info("redirection api call not allowed because redirection_api_call = 0 ");
}
}); // end of promise
@ -975,22 +982,6 @@ exports.test = async (req, res) => {
// exports.probedatatest = (req, res) => {
// Sync(function()
// {

View File

@ -7,7 +7,7 @@ module.exports = app => {
const { logMsg } = require('../services/logger.js');
var router = require("express").Router();
router.get("/test", financials.test);
/**
* @swagger
* /api/checkProbeStatus: