* @param {Function} next - Express next middleware function
* @returns {Promise<void>}
*/
- async show(req, res, next) {
+ async find_one(req, res, next) {
try {
const { id } = req.params;
const user = await db.user.find_one({ id: parseInt(id) });
* @param {Function} next - Express next middleware function
* @returns {Promise<void>}
*/
- async index(req, res, next) {
+ async find_many(req, res, next) {
try {
const { limit = 100, offset = 0, ...where } = req.query;
const users = await db.user.find_many(where, [], null, parseInt(limit), parseInt(offset));
module.exports = (passport) => {
router.post('/create', validate_auth(passport), users_controller.create);
router.get('/email/:email', validate_auth(passport), users_controller.find_by_email);
- /*router.get('/active', validate_auth(passport), users_controller.find_active);
router.get('/:id', validate_auth(passport), users_controller.find_one);
- router.get('/', validate_auth(passport), users_controller.find_many);*/
+ router.get('/', validate_auth(passport), users_controller.find_many);
router.put('/:id', validate_auth(passport), users_controller.update);
router.put('/:id/deactivate', validate_auth(passport), users_controller.deactivate);
router.put('/:id/reactivate', validate_auth(passport), users_controller.reactivate);