change getUserData to return err

v1.18.x
Baris Usakli 12 years ago
parent efa8717fc5
commit bb14881b63

@ -79,8 +79,8 @@
</div>
</div>
<div class="col-md-10">
<div>
<div class="col-md-5">
<div>
<form class='form-horizontal'>
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
@ -132,7 +132,11 @@
</form>
</div>
<hr />
<hr/>
</div>
<div class="col-md-5">
<div style="vertical-align:top;">
<form class='form-horizontal'>
<div class="control-group">

@ -29,9 +29,7 @@ var async = require('async'),
if (err) return next(err);
async.map(uids, function(uid, next) {
User.getUserData(uid, function(data) {
next(null, data);
});
User.getUserData(uid, next);
}, function(err, users) {
next(err, users);
});

@ -14,7 +14,7 @@ var user = require('./../user.js'),
if(!req.params.uid)
return res.redirect('/404');
user.getUserData(req.params.uid, function(data) {
user.getUserData(req.params.uid, function(err, data) {
if(data) {
res.send(data);
} else {
@ -406,7 +406,7 @@ var user = require('./../user.js'),
return;
}
user.getUserData(uid, function(data) {
user.getUserData(uid, function(err, data) {
if(data) {
data.joindate = utils.relativeTime(data.joindate);

@ -111,7 +111,7 @@ var utils = require('./../public/src/utils.js'),
if(exists === 1) {
console.log('deleting uid ' + uid);
User.getUserData(uid, function(data) {
User.getUserData(uid, function(err, data) {
RDB.del('username:' + data['username'] + ':uid');
RDB.del('email:' + data['email'] +':uid');
RDB.del('userslug:'+ data['userslug'] +':uid');
@ -175,15 +175,11 @@ var utils = require('./../public/src/utils.js'),
User.getUserData = function(uid, callback) {
RDB.hgetall('user:' + uid, function(err, data) {
if(err === null) {
if(data) {
if(data['password'])
delete data['password'];
}
callback(data);
} else {
console.log(err);
if(data && data['password']) {
delete data['password'];
}
callback(err, data);
});
}
@ -340,7 +336,7 @@ var utils = require('./../public/src/utils.js'),
}
function iterator(uid, callback) {
User.getUserData(uid, function(userData) {
User.getUserData(uid, function(err, userData) {
if(userData) {
data.push(userData);
}
@ -576,7 +572,7 @@ var utils = require('./../public/src/utils.js'),
}
function iterator(uid, callback) {
User.getUserData(uid, function(userData) {
User.getUserData(uid, function(err, userData) {
returnData.push(userData);
callback(null);

Loading…
Cancel
Save