mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-22 21:11:38 +02:00
Remove quick fix
This commit is contained in:
parent
78e337021e
commit
37afe2057f
@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class ConflictException.
|
|
||||||
*
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*/
|
|
||||||
class ConflictException extends Exception {}
|
|
@ -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);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -67,10 +65,6 @@ class GroupService
|
|||||||
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);
|
||||||
$group->loadCount('twofaccounts');
|
$group->loadCount('twofaccounts');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user