mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Removed unneeded checks when searching for asset
This commit is contained in:
parent
67e9b7795a
commit
e28e7e37b8
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue