mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Only try to process model bulk editing if at least one model was selected
This commit is contained in:
parent
809e310565
commit
447833c996
|
@ -376,6 +376,9 @@ class AssetModelsController extends Controller
|
|||
*/
|
||||
public function postBulkEdit(Request $request)
|
||||
{
|
||||
if (is_array($models_raw_array)) {
|
||||
|
||||
|
||||
$models_raw_array = Input::get('ids');
|
||||
$models = AssetModel::whereIn('id', $models_raw_array)->get();
|
||||
$nochange = ['NC' => 'No Change'];
|
||||
|
@ -390,6 +393,10 @@ class AssetModelsController extends Controller
|
|||
->with('category_list', $category_list)
|
||||
->with('fieldset_list', $fieldset_list)
|
||||
->with('depreciation_list', $depreciation_list);
|
||||
}
|
||||
|
||||
return redirect()->route('models.index')
|
||||
->with('error', 'You must select at least one model to edit.');
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue