Merge pull request #10122 from inietov/fixes/api_issue_when_component_checkout

Fixes API Issue when checking out a component
This commit is contained in:
snipe 2021-09-23 13:21:48 -07:00 committed by GitHub
commit 3862b6476b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,7 @@ class ComponentsController extends Controller
$this->authorize('checkout', $component); $this->authorize('checkout', $component);
if ($component->numRemaining() > $request->get('assigned_qty')) { if ($component->numRemaining() >= $request->get('assigned_qty')) {
if (!$asset = Asset::find($request->input('assigned_to'))) { if (!$asset = Asset::find($request->input('assigned_to'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist'))); return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')));