add more return

This commit is contained in:
CHIEFSOFT\ameye
2024-02-24 18:29:17 -05:00
parent 5bf6c50a26
commit 287980a30d
2 changed files with 19 additions and 5 deletions
+9 -3
View File
@@ -7,7 +7,7 @@ const logger = require('../app/logger');
var jobs = {
getmarketjobs: function (req, res, next) {
console.log("REQ---->",req.body.uid);
//console.log("REQ---->",req.body.uid);
var data = {
"uid": req.body.uid,
"member_id": req.body.member_id,
@@ -36,11 +36,17 @@ var jobs = {
" AND m.public_view = 1 AND m.expire> now() AND j.status = 1 " + QextraString +
" ORDER BY m.expire DESC LIMIT "+ data.limit;
logger.info(Qstring);
// logger.info(Qstring);
db.query(Qstring, function (err, result) {
try {
if (err) throw err;
next(null, result.rows); // pass control to the next handler
let resultItem ={
"result": result.rows,
"total_record": result.rowCount
}
// logger.info(result);
next(null, resultItem); // pass control to the next handler
// next(null, result.rows); // pass control to the next handler
} catch (e) {
next(e.message, null); // pass control to the next handler
}