Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 38ecf48

Browse files
committed
refactor @ chip, redirect is necessary
1 parent f30f827 commit 38ecf48

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/routes/groups/group.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ router.post('/:slug', access.isAdmin, function(req, res)
102102
// Remove reference to group from game
103103
Game.removeGroup(null, group._id, function(err)
104104
{
105-
done(err, "Game remove from " + group.name);
106-
});
105+
if(err) {
106+
done(err);
107+
return
108+
}
107109
// Remove the group
108110
group.remove(function(err)
109111
{
110112
req.flash('success', 'Deleted ' + group.name + ' successfully.');
111113
res.redirect('/groups');
112-
});
114+
})
115+
});
113116
break;
114117
}
115118
case "updateGroup":

0 commit comments

Comments
 (0)