'use strict'; const request = require('request'); const db = require('../app/db') const logger = require('../app/logger'); var members_action = { refreshActions: function (req, res, next) { logger.info(req.query); let Qstring = "SELECT id,uid,updated from members ORDER BY updated ASC LIMIT 2"; logger.info( Qstring ); db.query(Qstring, function (err, result) { try { if (err) throw err; if (result.rowCount > 0 ){ result.rows.map( (rw)=>{ console.log(rw); console.log(rw["uid"]); this.refreshActions(); }) } let resultItem ={ "result": result.rows, "total_record": result.rowCount } // logger.info(result); next(null, resultItem); // pass control to the next handler } catch (e) { next(e.message, null); // pass control to the next handler } }); }, updateSelection: async function (){ logger.info("Ameye-Called -The-Function") } }; module.exports = members_action;