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