Remove quick fix

This commit is contained in:
Bubka 2025-02-19 11:10:24 +01:00
parent 78e337021e
commit 37afe2057f
3 changed files with 0 additions and 27 deletions

View File

@ -1,12 +0,0 @@
<?php
namespace App\Exceptions;
use Exception;
/**
* Class ConflictException.
*
* @codeCoverageIgnore
*/
class ConflictException extends Exception {}

View File

@ -106,14 +106,5 @@ class Handler extends ExceptionHandler
], 401); ], 401);
} }
}); });
$this->renderable(function (ConflictException $exception, $request) {
return response()->json([
'message' => 'conflict',
'reason' => [$exception->getMessage()],
], 409);
});
} }
} }

View File

@ -2,7 +2,6 @@
namespace App\Services; namespace App\Services;
use App\Exceptions\ConflictException;
use App\Models\Group; use App\Models\Group;
use App\Models\TwoFAccount; use App\Models\TwoFAccount;
use App\Models\User; use App\Models\User;
@ -21,7 +20,6 @@ class GroupService
* @param mixed $targetGroup The group the accounts should be assigned to * @param mixed $targetGroup The group the accounts should be assigned to
* *
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
* @throws App\Exceptions\ConflictException
*/ */
public static function assign($ids, User $user, mixed $targetGroup = null) : void public static function assign($ids, User $user, mixed $targetGroup = null) : void
{ {
@ -66,10 +64,6 @@ class GroupService
if ($user->cannot('updateEach', [(new TwoFAccount), $twofaccounts])) { if ($user->cannot('updateEach', [(new TwoFAccount), $twofaccounts])) {
throw new AuthorizationException; throw new AuthorizationException;
} }
if (! $group) {
throw new ConflictException(__('errors.resource_not_found'));
}
// Proceed with assignment // Proceed with assignment
$group->twofaccounts()->saveMany($twofaccounts); $group->twofaccounts()->saveMany($twofaccounts);