Skip to content

Commit

Permalink
Fix for user count when accepting group invite
Browse files Browse the repository at this point in the history
  • Loading branch information
rbjarnason committed Jan 26, 2019
1 parent c5bfb2e commit 34835bc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server_api/controllers/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,8 @@ router.post('/accept_invite/:token', auth.isLoggedIn, function(req, res) {
invite.joined_at = Date.now();
invite.save().then(function (results) {
if (invite.Group) {
invite.Group.addGroupUsers(req.user).then(function (error) {
models.Group.addUserToGroupIfNeeded(invite.Group.id, req, function () {
res.send({name: invite.Group.name, redirectTo: "/group/"+ invite.Group.id});
});
models.Group.addUserToGroupIfNeeded(invite.Group.id, req, function () {
res.send({name: invite.Group.name, redirectTo: "/group/"+ invite.Group.id});
});
} else if (invite.Community) {
invite.Community.addCommunityUsers(req.user).then(function (error) {
Expand Down

0 comments on commit 34835bc

Please sign in to comment.