This commit is contained in:
psychobunny
2014-02-17 17:47:03 -05:00
parent 7918a23835
commit ed4b0461b9
3 changed files with 16 additions and 11 deletions

View File

@@ -13,14 +13,16 @@
expand: options.expand
}, next);
}, function (err, groups) {
// Remove deleted and hidden groups from this list
callback(err, groups.filter(function (group) {
if (parseInt(group.deleted, 10) === 1 || parseInt(group.hidden, 10) === 1) {
return false;
} else {
return true;
groups.forEach(function(group, g, arr) {
if (parseInt(group.deleted, 10) === 1) {
delete arr[g];
}
}));
if (parseInt(group.hidden, 10) === 1) {
group.deletable = 0;
}
});
callback(err, groups);
});
} else {
callback(null, []);