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:
parent
18c32a809b
commit
73e8183ffb
|
@ -131,7 +131,7 @@ const Group = RestModel.extend({
|
|||
return ajax(`/groups/${this.id}/join.json`, {
|
||||
type: "PUT",
|
||||
}).then(() => {
|
||||
this.findMembers();
|
||||
this.findMembers({}, true);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue