mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix removing all port groups (#14253)
* Fix removing all port groups * Make backend work in the situation where this endpoint is used for more than just this setting change change event is called multiple times when select2 is cleared (once for each item) prevent duplicate backend calls Remove no default Port Group item
This commit is contained in:
@@ -39,19 +39,6 @@ class PortGroupController extends SelectController
|
||||
return PortGroup::hasAccess($request->user())->select(['id', 'name']);
|
||||
}
|
||||
|
||||
protected function formatResponse($paginator)
|
||||
{
|
||||
// prepend the default group, unless filtered out
|
||||
if ($this->includeGeneral()) {
|
||||
$general = new PortGroup;
|
||||
$general->id = 0;
|
||||
$general->name = 'no default Port Group';
|
||||
$paginator->prepend($general);
|
||||
}
|
||||
|
||||
return parent::formatResponse($paginator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PortGroup $port_group
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user