v3 fix GET /groups: return an error only if an invalid type is supplied not when there are 0 results (#7203)

This commit is contained in:
Matteo Pagliazzi
2016-05-13 19:08:38 +02:00
parent 199732539f
commit 468a312357
3 changed files with 20 additions and 5 deletions

View File

@@ -100,10 +100,6 @@ api.getGroups = {
let sort = '-memberCount';
let results = await Group.getGroups({user, types, groupFields, sort});
// If no valid value for type was supplied, return an error
if (results.length === 0) throw new BadRequest(res.t('groupTypesRequired'));
res.respond(200, results);
},
};