Added initial get group tests

This commit is contained in:
Keith Holliday
2016-01-21 10:38:43 -06:00
parent 13693a041a
commit ab5fc1f526
3 changed files with 334 additions and 0 deletions
+7
View File
@@ -152,6 +152,13 @@ api.getGroup = {
let group = await Group.getGroup({user, groupId: req.params.groupId, populateLeader: true});
if (!group) throw new NotFound(res.t('groupNotFound'));
if (!user.contributor.admin) {
_.remove(group.chat, function removeChat (chat) {
chat.flags = {};
return chat.flagCount >= 2;
});
}
res.respond(200, group);
},
};