Removed unneeded checks when searching for asset
This commit is contained in:
parent
67e9b7795a
commit
e28e7e37b8
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue