FIX: update the list of users after user joined group (#13822)

* Make UI update after user have joined a public group

* Check if a group exists in the join method
This commit is contained in:
Andrei Prigorshnev 2021-07-22 18:48:26 +04:00 committed by GitHub
parent 18c32a809b
commit 73e8183ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -131,7 +131,7 @@ const Group = RestModel.extend({
return ajax(`/groups/${this.id}/join.json`, {
type: "PUT",
}).then(() => {
this.findMembers();
this.findMembers({}, true);
});
},

View File

@ -398,6 +398,7 @@ class GroupsController < ApplicationController
end
group = Group.find(params[:id])
raise Discourse::NotFound unless group
raise Discourse::InvalidAccess unless group.public_admission
return if group.users.exists?(id: current_user.id)