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:
Tony Murray
2022-08-28 20:57:16 -05:00
committed by GitHub
parent a664d12eb7
commit 323f0ea8b5
3 changed files with 21 additions and 20 deletions
@@ -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
*/