mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-06 14:25:36 +00:00
Fix qty requirements for Components API checkout
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@ -263,7 +263,7 @@ class ComponentsController extends Controller
|
||||
}
|
||||
|
||||
// Make sure there is at least one available to checkout
|
||||
if ($component->numRemaining() <= $request->get('assigned_qty')) {
|
||||
if ($component->numRemaining() < $request->get('assigned_qty')) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.checkout.unavailable', ['remaining' => $component->numRemaining(), 'requested' => $request->get('assigned_qty')])));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user