mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 03:06:23 +00:00
Redirect if nothing valid to modify/delete
This commit is contained in:
@ -344,6 +344,11 @@ class AssetModelsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid_count === 0) {
|
||||
return redirect()->route('models.index')
|
||||
->with('error', trans('admin/models/message.bulkdelete.nothing_deletable'));
|
||||
}
|
||||
|
||||
return view('models/bulk-delete', compact('models'))->with('valid_count', $valid_count);
|
||||
|
||||
// Otherwise display the bulk edit screen
|
||||
|
||||
@ -38,6 +38,11 @@ class BulkAssetModelsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid_count === 0) {
|
||||
return redirect()->route('models.index')
|
||||
->with('error', trans('admin/models/message.bulkdelete.nothing_deletable'));
|
||||
}
|
||||
|
||||
return view('models/bulk-delete', compact('models'))->with('valid_count', $valid_count);
|
||||
|
||||
// Otherwise display the bulk edit screen
|
||||
|
||||
@ -423,11 +423,16 @@ class LocationsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid_count === 0) {
|
||||
return redirect()->route('locations.index')
|
||||
->with('error', trans('general.bulk.delete.nothing_deletable', ['object_type' => trans_choice('general.location_plural', 2)]));
|
||||
}
|
||||
|
||||
return view('locations/bulk-delete', compact('locations'))->with('valid_count', $valid_count);
|
||||
}
|
||||
|
||||
return redirect()->route('models.index')
|
||||
->with('error', 'You must select at least one model to edit.');
|
||||
return redirect()->route('locations.index')
|
||||
->with('error', trans('general.bulk.delete.nothing_selected', ['object_type' => trans_choice('general.location_plural', 2)]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user