mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Grab the API
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
fe2cfa0d38
commit
7c88601066
|
@ -266,6 +266,14 @@ class ConsumablesController extends Controller
|
||||||
\Log::debug('No enough remaining');
|
\Log::debug('No enough remaining');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure there is a valid category
|
||||||
|
if (!$consumable->category){
|
||||||
|
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')]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if the user exists - @TODO: this should probably be handled via validation, not here??
|
// Check if the user exists - @TODO: this should probably be handled via validation, not here??
|
||||||
if (!$user = User::find($request->input('assigned_to'))) {
|
if (!$user = User::find($request->input('assigned_to'))) {
|
||||||
// Return error message
|
// Return error message
|
||||||
|
|
Loading…
Reference in a new issue