mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
groups: 404 when group not found
This commit is contained in:
parent
4650e2f592
commit
016a5030c5
1 changed files with 1 additions and 0 deletions
|
|
@ -194,6 +194,7 @@ api.update = function(req, res, next) {
|
|||
api.attachGroup = function(req, res, next) {
|
||||
Group.findById(req.params.gid, function(err, group){
|
||||
if(err) return res.json(500, {err:err});
|
||||
if(!group) return res.json(404, {err: "Group not found"});
|
||||
res.locals.group = group;
|
||||
next();
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue