Change the condition to 'bigger or equal' instead of just 'bigger than' in ComponentsController checkout api

This commit is contained in:
Ivan Nieto Vivanco 2021-09-23 15:02:39 -05:00
parent 3821c4d372
commit 7dfab3a6e2

View file

@ -220,7 +220,7 @@ class ComponentsController extends Controller
$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'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')));