Removed unneeded checks when searching for asset

This commit is contained in:
Nathan Butler 2022-06-29 17:49:50 +10:00
parent 67e9b7795a
commit e28e7e37b8

View file

@ -756,7 +756,7 @@ class AssetsController extends Controller
*/ */
public function checkoutByTag(AssetCheckoutRequest $request, $tag) public function checkoutByTag(AssetCheckoutRequest $request, $tag)
{ {
if ($asset = Asset::with('assetstatus')->with('assignedTo')->where('asset_tag', $tag)->first()) { if ($asset = Asset::where('asset_tag', $tag)->first()) {
return $this->checkout($request, $asset->id); return $this->checkout($request, $asset->id);
} }
return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200); return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);