mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
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:
@@ -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);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user