user js refactor, category fix

if a category that didn't exist was request with category/1231 or
api/category/1231 it was crashing.
This commit is contained in:
barisusakli
2014-03-12 20:53:42 -04:00
parent 67ef155c60
commit 90e398e5c9
12 changed files with 464 additions and 406 deletions

View File

@@ -186,10 +186,8 @@ Sockets.logoutUser = function(uid) {
};
Sockets.emitUserCount = function() {
db.getObjectField('global', 'userCount', function(err, count) {
io.sockets.emit('user.count', err?{message:err.message}:null, {
count: count
});
user.count(function(err, count) {
io.sockets.emit('user.count', err ? {message:err.message} : null, count);
});
};