mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Check for valid accessory category
This commit is contained in:
parent
35a20fb197
commit
132a5d424d
|
@ -258,10 +258,17 @@ class AccessoriesController extends Controller
|
||||||
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
|
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($accessory->category) {
|
||||||
|
|
||||||
$this->authorize('checkout', $accessory);
|
$this->authorize('checkout', $accessory);
|
||||||
|
|
||||||
// Get the dropdown of users and then pass it to the checkout view
|
// Get the dropdown of users and then pass it to the checkout view
|
||||||
return view('accessories/checkout', compact('accessory'));
|
return view('accessories/checkout', compact('accessory'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->back()->with('error', 'The category type for this accessory is not valid. Edit the accessory and select a valid accessory category.');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue