629 lines
23 KiB
JavaScript
629 lines
23 KiB
JavaScript
const { sequelize , LoanDetail , EntityDetails , ApplicantsDetails , ApplicantsRelationship , ResidenceAddressDetails , PropertyOwnershipIncomeConsidered , DueDiligenceCheck , TradeReferences , CheckTypeMaster} = require('../models')
|
|
const { logMsg } = require('../services/logger.js');
|
|
|
|
|
|
|
|
|
|
//create EntityDetails Api
|
|
exports.createEntityDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
EntityDetails.create(req.body).then(async(data) =>
|
|
{
|
|
CheckTypeMaster.findAll({raw: true , where : {is_active : 1}}).then(async(CheckTypeMasterData) =>
|
|
{
|
|
entityid = data.dataValues.id;
|
|
DueDiligenceCheckData = [];
|
|
for (const value of CheckTypeMasterData)
|
|
{
|
|
check_type_obj = {entity_id:entityid , check_type_id:value.id , check_type:value.value};
|
|
DueDiligenceCheckData.push(check_type_obj);
|
|
}
|
|
setTimeout(() => {
|
|
DueDiligenceCheck.bulkCreate(DueDiligenceCheckData)
|
|
.then(DueDiligenceCheckData =>{ logMsg.info("DueDiligenceCheck Data Creation Success for EntityId= "+entityid); })
|
|
.catch(err =>{ logMsg.info("DueDiligenceCheck Data Creation Failed for EntityId= "+entityid+" Error= "+err); });
|
|
}, 500);
|
|
})
|
|
.catch(err => { logMsg.info("DueDiligenceCheckType Data Fetching Failed for EntityId= "+entityid+" Error= "+err); });
|
|
setTimeout(() => {
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}, 1000);
|
|
|
|
logMsg.info("Entity created successfully");
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//update Entity Details Api
|
|
exports.updateEntityDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
delete req.body.id;
|
|
// update check value
|
|
EntityDetails.update(req.body,{ where: { id: id }}).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//create Applicant Details with ResidenceAddress & ApplicantRelationship & PropertyOwnership Details (or) Applicant Details with PropertyOwnership Details
|
|
exports.createApplicantDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
ApplicantsRelationshipData = req.body.applicant_relationship;
|
|
ResidenceAddressDetailsData = req.body.residence_address;
|
|
PropertyOwnershipIncomeConsideredData = req.body.property_ownership_income_considered;
|
|
delete req.body.applicant_relationship
|
|
delete req.body.residence_address
|
|
delete req.body.property_ownership_income_considered ;
|
|
|
|
await ApplicantsDetails.create(req.body).then(async (data) =>
|
|
{
|
|
if(req.body.entity_type == "Individual")
|
|
{
|
|
ApplicantsRelationshipData = Object.assign(ApplicantsRelationshipData, {loan_no_id: req.body.loan_no_id});
|
|
ApplicantsRelationshipData = Object.assign(ApplicantsRelationshipData, {applicant_id: data.dataValues.id});
|
|
await ApplicantsRelationship.create(ApplicantsRelationshipData)
|
|
.then(data=>{logMsg.info("ApplicantsRelationship inserted");}).catch(err=>{logMsg.info("ApplicantsRelationship Failed , Msg :" +err);});
|
|
|
|
ResidenceAddressDetailsData = Object.assign(ResidenceAddressDetailsData, {loan_no_id: req.body.loan_no_id});
|
|
ResidenceAddressDetailsData = Object.assign(ResidenceAddressDetailsData, {applicant_id: data.dataValues.id});
|
|
await ResidenceAddressDetails.create(ResidenceAddressDetailsData)
|
|
.then(data=>{logMsg.info("ResidenceAddressDetails inserted");}).catch(err=>{logMsg.info("ResidenceAddressDetails Failed , Msg :" +err);});
|
|
|
|
PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {loan_no_id: req.body.loan_no_id});
|
|
PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {applicant_id: data.dataValues.id});
|
|
await PropertyOwnershipIncomeConsidered.create(PropertyOwnershipIncomeConsideredData)
|
|
.then(data=>{logMsg.info("PropertyOwnershipIncomeConsidered inserted");}).catch(err=>{logMsg.info("PropertyOwnershipIncomeConsidered Failed , Msg :" +err);});
|
|
}
|
|
else
|
|
{
|
|
PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {loan_no_id: req.body.loan_no_id});
|
|
PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {applicant_id: data.dataValues.id});
|
|
await PropertyOwnershipIncomeConsidered.create(PropertyOwnershipIncomeConsideredData)
|
|
.then(data=>{logMsg.info("PropertyOwnershipIncomeConsidered inserted");}).catch(err=>{logMsg.info("PropertyOwnershipIncomeConsidered Failed , Msg :" +err);});
|
|
}
|
|
|
|
// send response here
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//update ApplicantDetails
|
|
exports.updateApplicantDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
delete req.body.id;
|
|
ApplicantsDetails.findOne({raw: true , where: { id: id }}).then(async (ApplicantsDetailsData) =>
|
|
{
|
|
if(ApplicantsDetailsData.name != req.body.name)
|
|
{
|
|
ApplicantsDetails.update(req.body,{ where: { id: id }}).then(async(data) =>
|
|
{
|
|
await ApplicantsRelationship.update({name_of_the_individual:req.body.name},{ where: { applicant_id: id , is_active : 1}})
|
|
.then(data=>{logMsg.info("ApplicantsRelationship name updated");}).catch(err=>{logMsg.info("ApplicantsRelationship name update Failed , Msg :" +err);});
|
|
|
|
await ResidenceAddressDetails.update({name_of_the_individual:req.body.name},{ where: { applicant_id: id , is_active : 1}})
|
|
.then(data=>{logMsg.info("ApplicantsRelationship name updated");}).catch(err=>{logMsg.info("ApplicantsRelationship name update Failed , Msg :" +err);});
|
|
|
|
await PropertyOwnershipIncomeConsidered.update({name_of_the_loan_applicants:req.body.name,applicant_type:req.body.applicant_type},{ where: { applicant_id: id , is_active : 1}})
|
|
.then(data=>{logMsg.info("ApplicantsRelationship name updated");}).catch(err=>{logMsg.info("ApplicantsRelationship name update Failed , Msg :" +err);});
|
|
|
|
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
|
|
}
|
|
else if (ApplicantsDetailsData.applicant_type != req.body.applicant_type)
|
|
{
|
|
ApplicantsDetails.update(req.body,{ where: { id: id }}).then(async(data) =>
|
|
{
|
|
await PropertyOwnershipIncomeConsidered.update({applicant_type:req.body.applicant_type},{ where: { applicant_id: id , is_active : 1}})
|
|
.then(data=>{logMsg.info("ApplicantsRelationship name updated");}).catch(err=>{logMsg.info("ApplicantsRelationship name update Failed , Msg :" +err);});
|
|
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
}).catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
}
|
|
else
|
|
{
|
|
ApplicantsDetails.update(req.body,{ where: { id: id }}).then(async(data) =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
}).catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
}
|
|
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
|
|
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//update ApplicantsRelationship Api (Deactivate old value create new record)
|
|
exports.updateApplicantsRelationship = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
updatedby = req.body.updatedby;
|
|
delete req.body.id;
|
|
delete req.body.updatedby;
|
|
// update old value is_active = 0 where requested id
|
|
await ApplicantsRelationship.update({ updatedby : updatedby ,is_active : 0 },{ where: { id: id }});
|
|
// create new entry
|
|
ApplicantsRelationship.create(req.body).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
}
|
|
|
|
|
|
//update ResidenceAddressDetails Api (Deactivate old value create new record)
|
|
exports.updateResidenceAddressDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
updatedby = req.body.updatedby;
|
|
delete req.body.id;
|
|
delete req.body.updatedby;
|
|
// update old value is_active = 0 where requested id
|
|
await ResidenceAddressDetails.update({ updatedby : updatedby ,is_active : 0 },{ where: { id: id }});
|
|
// create new entry
|
|
ResidenceAddressDetails.create(req.body).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
}
|
|
|
|
|
|
//update PropertyOwnership and IncomeConsidered data Api (Deactivate old value create new record)
|
|
exports.updatePropertyOwnershipIncomeConsidered = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
updatedby = req.body.updatedby;
|
|
delete req.body.id;
|
|
delete req.body.updatedby;
|
|
// update old value is_active = 0 where requested id
|
|
await PropertyOwnershipIncomeConsidered.update({ updatedby : updatedby ,is_active : 0 },{ where: { id: id }});
|
|
// create new entry
|
|
PropertyOwnershipIncomeConsidered.create(req.body).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
}
|
|
|
|
|
|
//create TradeReferencesDetails Api
|
|
exports.createTradeReferencesDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
TradeReferences.create(req.body).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//update TradeReferencesDetails Api (Deactivate old value create new record)
|
|
exports.updateTradeReferencesDetails = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
updatedby = req.body.updatedby;
|
|
delete req.body.id;
|
|
delete req.body.updatedby;
|
|
// update old value is_active = 0 where requested id
|
|
await TradeReferences.update({ updatedby : updatedby ,is_active : 0 },{ where: { id: id }});
|
|
// create new entry
|
|
TradeReferences.create(req.body).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//update DueDiligenceCheck Api
|
|
exports.updateDueDiligenceCheck = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
id = req.body.id;
|
|
delete req.body.id;
|
|
// update value
|
|
DueDiligenceCheck.update(req.body,{ where: { id: id }}).then(data =>
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//LoanNumberDetails List Api
|
|
exports.LoanNumberDetailsList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
LoanDetail.findAll({raw: true , where : {is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//EntityDetails List Api
|
|
exports.EntityDetailsList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
EntityDetails.findAll({raw: true ,where:{loan_no_id : req.query.loan_no_id , is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//ApplicantDetails List Api
|
|
exports.ApplicantDetailsList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
ApplicantsDetails.findAll({raw: true , where:{loan_no_id : req.query.loan_no_id , is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//ApplicantRelationship List Api
|
|
exports.ApplicantRelationshipList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
ApplicantsRelationship.findAll({raw: true , where:{loan_no_id : req.query.loan_no_id , is_active : 1 }}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//ResidenceAddressDetails List Api
|
|
exports.ResidenceAddressDetailsList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
ResidenceAddressDetails.findAll({raw: true , where:{loan_no_id : req.query.loan_no_id , is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//PropertyOwnership List Api
|
|
exports.PropertyOwnershipList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
PropertyOwnershipIncomeConsidered.findAll({raw: true , where:{loan_no_id : req.query.loan_no_id , is_active : 1 }}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//DueDiligenceCheck List Api
|
|
exports.DueDiligenceCheckList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
DueDiligenceCheck.findAll({raw: true , where : {entity_id : req.query.entity_id , is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
//TradeReferences List Api
|
|
exports.TradeReferencesList = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
TradeReferences.findAll({raw: true , where : {entity_id : req.query.entity_id , is_active : 1}}).then(data =>
|
|
{
|
|
if(data.length > 0)
|
|
{
|
|
res.send({'status':200,'message':"success",'data':data});
|
|
}
|
|
else {
|
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
|
}
|
|
|
|
|
|
})
|
|
.catch(err => {
|
|
res.send({'status':404,
|
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
|
});
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|
|
|
|
|
|
// test api
|
|
exports.test = async (req, res) =>
|
|
{
|
|
try
|
|
{
|
|
start_date = "'2019-08-12'";
|
|
let starting_date = new Date(start_date);
|
|
end_date = "'2021-05-12'";
|
|
let date = new Date(end_date);
|
|
|
|
years_skeleton = [];
|
|
for(let i=0;i<12;i++)
|
|
{
|
|
//store on fly month number
|
|
month_count = date.getMonth() + 1;
|
|
//create on fly month data
|
|
new_date = date.toLocaleString('default', { month: 'short' })+"-"+date.getFullYear();
|
|
//create on fly period data
|
|
new_period = date.getFullYear()+"-"+month_count+"-01";
|
|
obj = {month:new_date,period:new_period};
|
|
// push skeleton object
|
|
years_skeleton.push(obj);
|
|
//Reset date here
|
|
date.setMonth(date.getMonth() - 1);
|
|
//check if loop meets starting date or not
|
|
if(starting_date.getFullYear() == date.getFullYear() && starting_date.getMonth() + 1 == month_count) { break; }
|
|
}
|
|
|
|
console.log(years_skeleton);
|
|
|
|
} catch(err) {
|
|
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
|
} //end of try catch
|
|
|
|
};
|
|
|