ensl_gathers/lib/user/helper.js
2015-08-28 15:00:14 +01:00

17 lines
383 B
JavaScript

"use strict";
var User = require("../user/user");
var client = require("../ensl/client")();
var async = require("async");
var getRandomUser = callback => {
let id = Math.floor(Math.random() * 5000) + 1;
User.find(id, function (error, user) {
if (error) return getRandomUser(callback);
return callback(error, user);
})
};
module.exports = {
getRandomUser: getRandomUser
};