Remove duplicate authorization check

This commit is contained in:
Marcus Moore 2024-02-14 10:48:41 -08:00
parent ad1846fed6
commit 7bfd02054b
No known key found for this signature in database

View file

@ -864,11 +864,9 @@ class AssetsController extends Controller
*/ */
public function checkin(Request $request, $asset_id) public function checkin(Request $request, $asset_id)
{ {
$this->authorize('checkin', Asset::class);
$asset = Asset::with('model')->findOrFail($asset_id); $asset = Asset::with('model')->findOrFail($asset_id);
$this->authorize('checkin', $asset); $this->authorize('checkin', $asset);
$target = $asset->assignedTo; $target = $asset->assignedTo;
if (is_null($target)) { if (is_null($target)) {
return response()->json(Helper::formatStandardApiResponse('error', [ return response()->json(Helper::formatStandardApiResponse('error', [