WIP commit -- groups refactoring + upgrade scripts

This commit is contained in:
Julian Lam
2014-03-19 20:33:39 -04:00
parent 2f8ecc00d8
commit c893effcb9
4 changed files with 161 additions and 74 deletions

View File

@@ -275,7 +275,7 @@ module.exports = function(User) {
deleteUserFromFollowers(uid, next);
},
function(next) {
deleteUserFromGroups(uid, next);
groups.leaveAllGroups(uid, next);
}
], function(err) {
if (err) {
@@ -320,12 +320,4 @@ module.exports = function(User) {
}, callback);
});
}
function deleteUserFromGroups(uid, callback) {
groups.getGroupIds(function(err, gids) {
async.each(gids, function(gid, next) {
groups.leave(gid, uid, next);
}, callback);
});
}
};