:losNullIssue:GWM
This commit is contained in:
parent
f3b1969c75
commit
349553d4e3
@ -11,7 +11,28 @@ const moment = require('moment');
|
||||
exports.mainLandingPage = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
|
||||
if(req.query.losid == null)
|
||||
{
|
||||
LoanDetail.findAll({raw: true }).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" });
|
||||
});
|
||||
}else{
|
||||
|
||||
|
||||
|
||||
Loan_Detail_Losid = await LoanDetail.findOne({ where : { losid : req.query.losid , is_active : 1}})
|
||||
if (Loan_Detail_Losid == undefined)
|
||||
{
|
||||
@ -179,6 +200,10 @@ exports.mainLandingPage = async (req, res) =>
|
||||
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
||||
});
|
||||
} // Los api call failed
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // end of try block
|
||||
catch(err)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user