switch to auth()->user from session

This commit is contained in:
Andras Bacsai
2023-08-11 17:31:53 +02:00
parent e60ec6c47e
commit 833e45155d
32 changed files with 90 additions and 77 deletions

View File

@@ -11,19 +11,19 @@ class Member extends Component
public function makeAdmin()
{
$this->member->teams()->updateExistingPivot(session('currentTeam')->id, ['role' => 'admin']);
$this->member->teams()->updateExistingPivot(auth()->user()->currentTeam()->id, ['role' => 'admin']);
$this->emit('reloadWindow');
}
public function makeReadonly()
{
$this->member->teams()->updateExistingPivot(session('currentTeam')->id, ['role' => 'member']);
$this->member->teams()->updateExistingPivot(auth()->user()->currentTeam()->id, ['role' => 'member']);
$this->emit('reloadWindow');
}
public function remove()
{
$this->member->teams()->detach(session('currentTeam'));
$this->member->teams()->detach(auth()->user()->currentTeam());
$this->emit('reloadWindow');
}
}