mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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`, {
|
return ajax(`/groups/${this.id}/join.json`, {
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.findMembers();
|
this.findMembers({}, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -398,6 +398,7 @@ class GroupsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
group = Group.find(params[:id])
|
group = Group.find(params[:id])
|
||||||
|
raise Discourse::NotFound unless group
|
||||||
raise Discourse::InvalidAccess unless group.public_admission
|
raise Discourse::InvalidAccess unless group.public_admission
|
||||||
|
|
||||||
return if group.users.exists?(id: current_user.id)
|
return if group.users.exists?(id: current_user.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user