From 37afe2057f91084512de80ca0952903d2613578b Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Wed, 19 Feb 2025 11:10:24 +0100 Subject: [PATCH] Remove quick fix --- app/Exceptions/ConflictException.php | 12 ------------ app/Exceptions/Handler.php | 9 --------- app/Services/GroupService.php | 6 ------ 3 files changed, 27 deletions(-) delete mode 100644 app/Exceptions/ConflictException.php diff --git a/app/Exceptions/ConflictException.php b/app/Exceptions/ConflictException.php deleted file mode 100644 index 1d92dabb..00000000 --- a/app/Exceptions/ConflictException.php +++ /dev/null @@ -1,12 +0,0 @@ -renderable(function (ConflictException $exception, $request) { - return response()->json([ - 'message' => 'conflict', - 'reason' => [$exception->getMessage()], - ], 409); - }); - - } } diff --git a/app/Services/GroupService.php b/app/Services/GroupService.php index 62c12fd1..6de1444c 100644 --- a/app/Services/GroupService.php +++ b/app/Services/GroupService.php @@ -2,7 +2,6 @@ namespace App\Services; -use App\Exceptions\ConflictException; use App\Models\Group; use App\Models\TwoFAccount; use App\Models\User; @@ -21,7 +20,6 @@ class GroupService * @param mixed $targetGroup The group the accounts should be assigned to * * @throws \Illuminate\Auth\Access\AuthorizationException - * @throws App\Exceptions\ConflictException */ public static function assign($ids, User $user, mixed $targetGroup = null) : void { @@ -66,10 +64,6 @@ class GroupService if ($user->cannot('updateEach', [(new TwoFAccount), $twofaccounts])) { throw new AuthorizationException; } - - if (! $group) { - throw new ConflictException(__('errors.resource_not_found')); - } // Proceed with assignment $group->twofaccounts()->saveMany($twofaccounts);