v1.18.x
barisusakli 11 years ago
parent 37115ea3d6
commit f562caaa61

@ -310,12 +310,10 @@ var
emitter.on('event:newpost', User.onNewPostMade); emitter.on('event:newpost', User.onNewPostMade);
User.incrementUserPostCountBy = function(uid, value, callback) { User.incrementUserPostCountBy = function(uid, value, callback) {
callback = callback || function() {};
User.incrementUserFieldBy(uid, 'postcount', value, function(err, newpostcount) { User.incrementUserFieldBy(uid, 'postcount', value, function(err, newpostcount) {
if (err) { if (err) {
if(typeof callback === 'function') { return callback(err);
callback(err);
}
return;
} }
db.sortedSetAdd('users:postcount', newpostcount, uid, callback); db.sortedSetAdd('users:postcount', newpostcount, uid, callback);
}); });

Loading…
Cancel
Save