mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Move the early return to the controller instead of the Label model
This commit is contained in:
parent
085a993340
commit
91b1cc7121
|
@ -58,8 +58,14 @@ class BulkAssetsController extends Controller
|
|||
switch ($request->input('bulk_actions')) {
|
||||
case 'labels':
|
||||
$this->authorize('view', Asset::class);
|
||||
$assets_found = Asset::find($asset_ids);
|
||||
|
||||
if ($assets_found->isEmpty()){
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
return (new Label)
|
||||
->with('assets', Asset::find($asset_ids))
|
||||
->with('assets', $assets_found)
|
||||
->with('settings', Setting::getSettings())
|
||||
->with('bulkedit', true)
|
||||
->with('count', 0);
|
||||
|
|
|
@ -40,10 +40,6 @@ class Label implements View
|
|||
$offset = $this->data->get('offset');
|
||||
$template = $this->data->get('template');
|
||||
|
||||
if ($assets->isEmpty()){
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
// If disabled, pass to legacy view
|
||||
if ((!$settings->label2_enable) && (!$template)) {
|
||||
return view('hardware/labels')
|
||||
|
|
Loading…
Reference in a new issue