Group admins can't leave by clicking 'member' button
This commit is contained in:
parent
3d06e94595
commit
2b99918b26
|
@ -47,12 +47,12 @@ class Api::V1::Groups::AccountsController < Api::BaseController
|
||||||
@join_request.destroy_all
|
@join_request.destroy_all
|
||||||
else
|
else
|
||||||
authorize @group, :leave?
|
authorize @group, :leave?
|
||||||
GroupAccount.where(group: @group, account_id: current_account.id).destroy_all
|
GroupAccount.where(group: @group, account_id: current_account.id, role: nil).destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: @group, serializer: REST::GroupRelationshipSerializer, relationships: relationships
|
render json: @group, serializer: REST::GroupRelationshipSerializer, relationships: relationships
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def relationships
|
def relationships
|
||||||
|
|
Loading…
Reference in New Issue