Fixed "remove member" bug
This commit is contained in:
@@ -358,8 +358,8 @@ class OrganisationMembersController extends SimpleController
|
||||
}
|
||||
|
||||
// Check if the user is a member of the organisation, pending or no relation at all
|
||||
$memberCheck = $organisation->members()->where('user_id', $currentUser->id)->withPivot('flag_approved')->first();
|
||||
$adminCheck = $organisation->administrators()->where('user_id', $currentUser->id)->withPivot('flag_approved')->first();
|
||||
$memberCheck = $organisation->members()->where('user_id', $user->id)->withPivot('flag_approved')->first();
|
||||
$adminCheck = $organisation->administrators()->where('user_id', $user->id)->withPivot('flag_approved')->first();
|
||||
if (!($memberCheck && $memberCheck->pivot->flag_approved) && !($adminCheck && $adminCheck->pivot->flag_approved)) {
|
||||
$ms->addMessageTranslated('danger', 'ORGANISATION.MEMBER.NOT_FOUND', [
|
||||
'name' => $organisation->name,
|
||||
|
||||
Reference in New Issue
Block a user