mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Merge pull request #13933 from snipe/fixes/removed_extra_return
Removed extra return statement in consumables API checkout method
This commit is contained in:
commit
3a0b994443
|
@ -263,14 +263,11 @@ class ConsumablesController extends Controller
|
||||||
// Make sure there is at least one available to checkout
|
// Make sure there is at least one available to checkout
|
||||||
if ($consumable->numRemaining() <= 0) {
|
if ($consumable->numRemaining() <= 0) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/consumables/message.checkout.unavailable')));
|
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/consumables/message.checkout.unavailable')));
|
||||||
\Log::debug('No enough remaining');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure there is a valid category
|
// Make sure there is a valid category
|
||||||
if (!$consumable->category){
|
if (!$consumable->category){
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.invalid_item_category_single', ['type' => trans('general.consumable')])));
|
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.invalid_item_category_single', ['type' => trans('general.consumable')])));
|
||||||
|
|
||||||
return redirect()->route('consumables.index')->with('error', trans('general.invalid_item_category_single', ['type' => trans('general.consumable')]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue