* Rework user.js and User object to ES6

* Update download stats for user when web download is completed
This commit is contained in:
Bryan Ashby 2017-02-18 13:21:18 -07:00
parent 6406d32165
commit 058ff3f367
14 changed files with 569 additions and 516 deletions

View file

@ -196,19 +196,18 @@ function initialize(cb) {
// * We do this every time as the op is free to change this information just
// like any other user
//
const user = require('./user.js');
const User = require('./user.js');
async.waterfall(
[
function getOpUserName(next) {
return user.getUserName(1, next);
return User.getUserName(1, next);
},
function getOpProps(opUserName, next) {
const propLoadOpts = {
userId : 1,
names : [ 'real_name', 'sex', 'email_address', 'location', 'affiliation' ],
};
user.loadProperties(propLoadOpts, (err, opProps) => {
User.loadProperties(User.RootUserID, propLoadOpts, (err, opProps) => {
return next(err, opUserName, opProps);
});
}