diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index f1f0018a89..74ba2cf6db 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -820,7 +820,6 @@ class AssetsController extends Controller 'asset_tag' => $asset->asset_tag, ]; - // This item is checked out to a location if (request('checkout_to_type') == 'location') { $target = Location::find(request('assigned_location')); @@ -851,7 +850,6 @@ class AssetsController extends Controller $asset->status_id = $request->get('status_id'); } - if (! isset($target)) { // @todo: test this code path return response()->json(Helper::formatStandardApiResponse('error', $error_payload, 'Checkout target for asset '.e($asset->asset_tag).' is invalid - '.$error_payload['target_type'].' does not exist.')); @@ -875,8 +873,6 @@ class AssetsController extends Controller // $asset->location_id = $target->rtd_location_id; // } - - if ($asset->checkOut($target, Auth::user(), $checkout_at, $expected_checkin, $note, $asset_name, $asset->location_id)) { return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.success'))); }