upd
This commit is contained in:
@ -687,6 +687,41 @@ class JustificationAdapter extends Adapter{
|
||||
}
|
||||
}
|
||||
|
||||
async queryListCheckedAndApprovedBy(req,callback){
|
||||
var apires = this.getApiResultDefined();
|
||||
try {
|
||||
|
||||
let qry = "select * from vw_checked_and_approved_by order by id asc";
|
||||
|
||||
// console.log(qry);
|
||||
db.query(qry,[],function(err,result,fields){
|
||||
if(err){
|
||||
apires.meta['message'] = err.toString();
|
||||
apires.meta['code'] = 500;
|
||||
callback('err',apires);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(result.length>0){
|
||||
apires.success = true;
|
||||
apires.data = JSON.parse(JSON.stringify(result));
|
||||
}
|
||||
else{
|
||||
apires.meta.code = 200;
|
||||
apires.meta.message = "Record Not Found";
|
||||
}
|
||||
callback(null, apires);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} catch (err) {
|
||||
apires.meta.code = 500;
|
||||
apires.meta.message = err.toString();
|
||||
callback('error',apires);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async queryJustificationDetail(req,callback){
|
||||
var apires = this.getApiResultDefined();
|
||||
|
||||
@ -123,6 +123,21 @@ exports.getListApprovedBy = ( req, res ) => {
|
||||
}
|
||||
}
|
||||
|
||||
exports.getListCheckedAndApprovedBy = ( req, res ) => {
|
||||
try{
|
||||
justificationadapter.queryListCheckedAndApprovedBy(req,function(err,data){
|
||||
let statusCode = data!=null ? data.meta.code : 200 ;
|
||||
if(err) statusCode = 500;
|
||||
justificationadapter.sendResponse(statusCode,data, res);
|
||||
});
|
||||
}
|
||||
catch(err){
|
||||
apireshandler.meta.code = 502;
|
||||
apireshandler.meta.message = " [75] : Justification controller, " + err.toString();
|
||||
justificationadapter.sendResponse(502, apireshandler, res);
|
||||
}
|
||||
}
|
||||
|
||||
exports.deleteJustification = ( req, res ) => {
|
||||
try{
|
||||
justificationadapter.queryDeleteJustification(req,function(err,data){
|
||||
|
||||
@ -10,6 +10,7 @@ router.get('/getlistbudgetrequest',[jwtauth], justificationcontroller.getListBud
|
||||
router.get('/getlistcreatedby',[jwtauth], justificationcontroller.getListCreatedBy);
|
||||
router.get('/getlistcheckedby',[jwtauth], justificationcontroller.getListCheckedBy);
|
||||
router.get('/getlistapprovedby',[jwtauth], justificationcontroller.getListApprovedBy);
|
||||
router.get('/getlistcheckedandapprovedby',[jwtauth], justificationcontroller.getListCheckedAndApprovedBy);
|
||||
router.post('/setnewjustification',[jwtauth, uploadfile], justificationcontroller.newJustification);
|
||||
router.post('/deletejustification',[jwtauth], justificationcontroller.deleteJustification);
|
||||
router.post('/updatejustification',[jwtauth, uploadfile], justificationcontroller.updateJustification);
|
||||
|
||||
Reference in New Issue
Block a user