diff --git a/src/api/controllers/v1/user.controller.js b/src/api/controllers/v1/user.controller.js index 7eedf36..99af8e9 100644 --- a/src/api/controllers/v1/user.controller.js +++ b/src/api/controllers/v1/user.controller.js @@ -43,21 +43,37 @@ exports.create = async (req, res, next) => { exports.list = async (req, res, next) => { req.query.services = User.Services.USER; // console.log(req.query.services); - User.list( { - service : "user", - is_active: true - } - ).then(result => { - res.json({ - code: 0, - count: req.totalRecords, - data: result.map( - x => User.transform(x) - ) + // User.list( { + // service : "user", + // is_active: true + // } + // ).then(result => { + // res.json({ + // code: 0, + // count: req.totalRecords, + // data: result.map( + // x => User.transform(x) + // ) + // }); + // }).catch(ex => { + // ErrorHandler(ex, req, res, next); + // }); + + + return User.findAll({ + where : { + service : "user", + is_active: true + } + }).then(result => { + res.json({ + code: 0, + count: req.totalRecords, + data: result + }); + }).catch(ex => { + ErrorHandler(ex, req, res, next); }); - }).catch(ex => { - ErrorHandler(ex, req, res, next); - }); }; /**