mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Manage Host Page (Bug fix): Transfer and delete hosts updates total host count (#2501)
* refetchHosts includes retrieveHosts and retrieveHostCount
This commit is contained in:
parent
01d38150c8
commit
3ca3b1c823
2 changed files with 9 additions and 2 deletions
1
changes/fix-2501-transfer-delete-updates-host-count
Normal file
1
changes/fix-2501-transfer-delete-updates-host-count
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Bug fix: Transferring and deleting hosts updates host count
|
||||
|
|
@ -332,6 +332,11 @@ const ManageHostsPage = ({
|
|||
}
|
||||
};
|
||||
|
||||
const refetchHosts = (options: IHostCountLoadOptions) => {
|
||||
retrieveHosts(options);
|
||||
retrieveHostCount(options);
|
||||
};
|
||||
|
||||
// triggered every time the route is changed
|
||||
// which means every filter click and text search
|
||||
useDeepEffect(() => {
|
||||
|
|
@ -743,7 +748,7 @@ const ManageHostsPage = ({
|
|||
: `Hosts successfully transferred to ${team.name}.`;
|
||||
|
||||
dispatch(renderFlash("success", successMessage));
|
||||
retrieveHosts({
|
||||
refetchHosts({
|
||||
selectedLabels: selectedFilters,
|
||||
globalFilter: searchQuery,
|
||||
sortBy,
|
||||
|
|
@ -788,7 +793,7 @@ const ManageHostsPage = ({
|
|||
} successfully deleted.`;
|
||||
|
||||
dispatch(renderFlash("success", successMessage));
|
||||
retrieveHosts({
|
||||
refetchHosts({
|
||||
selectedLabels: selectedFilters,
|
||||
globalFilter: searchQuery,
|
||||
sortBy,
|
||||
|
|
@ -796,6 +801,7 @@ const ManageHostsPage = ({
|
|||
policyId,
|
||||
policyResponse,
|
||||
});
|
||||
|
||||
refetchLabels();
|
||||
toggleDeleteHostModal();
|
||||
setSelectedHostIds([]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue