Revert "rector: arrrrr"

This reverts commit 16c0cd10d8.
This commit is contained in:
Andras Bacsai
2025-01-07 15:31:43 +01:00
parent da07b4fdcf
commit 1fe4dd722b
349 changed files with 3689 additions and 4184 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Livewire\Team;
use App\Enums\Role;
use App\Models\User;
use Exception;
use Illuminate\Support\Facades\Cache;
use Livewire\Component;
@@ -17,11 +16,11 @@ class Member extends Component
try {
if (Role::from(auth()->user()->role())->lt(Role::ADMIN)
|| Role::from($this->getMemberRole())->gt(auth()->user()->role())) {
throw new Exception('You are not authorized to perform this action.');
throw new \Exception('You are not authorized to perform this action.');
}
$this->member->teams()->updateExistingPivot(currentTeam()->id, ['role' => Role::ADMIN->value]);
$this->dispatch('reloadWindow');
} catch (Exception $e) {
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
}
}
@@ -31,11 +30,11 @@ class Member extends Component
try {
if (Role::from(auth()->user()->role())->lt(Role::OWNER)
|| Role::from($this->getMemberRole())->gt(auth()->user()->role())) {
throw new Exception('You are not authorized to perform this action.');
throw new \Exception('You are not authorized to perform this action.');
}
$this->member->teams()->updateExistingPivot(currentTeam()->id, ['role' => Role::OWNER->value]);
$this->dispatch('reloadWindow');
} catch (Exception $e) {
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
}
}
@@ -45,11 +44,11 @@ class Member extends Component
try {
if (Role::from(auth()->user()->role())->lt(Role::ADMIN)
|| Role::from($this->getMemberRole())->gt(auth()->user()->role())) {
throw new Exception('You are not authorized to perform this action.');
throw new \Exception('You are not authorized to perform this action.');
}
$this->member->teams()->updateExistingPivot(currentTeam()->id, ['role' => Role::MEMBER->value]);
$this->dispatch('reloadWindow');
} catch (Exception $e) {
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
}
}
@@ -59,7 +58,7 @@ class Member extends Component
try {
if (Role::from(auth()->user()->role())->lt(Role::ADMIN)
|| Role::from($this->getMemberRole())->gt(auth()->user()->role())) {
throw new Exception('You are not authorized to perform this action.');
throw new \Exception('You are not authorized to perform this action.');
}
$this->member->teams()->detach(currentTeam());
Cache::forget("team:{$this->member->id}");
@@ -67,7 +66,7 @@ class Member extends Component
return $this->member->teams()->first();
});
$this->dispatch('reloadWindow');
} catch (Exception $e) {
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
}
}