3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-05-05 22:25:34 +00:00

Remove unnecessary try/catch

This commit is contained in:
Ivan Nieto Vivanco
2023-03-02 19:50:47 -06:00
parent e0b2dc043a
commit 95f568b934

View File

@ -459,11 +459,7 @@ class UsersController extends Controller
}
// The groups field has been passed but it is null, so we should blank it out
} elseif ($request->has('groups')) {
try{
$user->groups()->sync([]);
} catch (\Exception $exception){
return response()->json(Helper::formatStandardApiResponse('error', null, $exception));
}
$user->groups()->sync([]);
}