From b2c089c3510995dc78a4df894d96ff0ce23f917e Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:08:41 -0400 Subject: [PATCH] Fleet FE: Do not pass empty search string to API for bulk transfer/delete hosts (#17525) --- frontend/services/entities/hosts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/services/entities/hosts.ts b/frontend/services/entities/hosts.ts index b29e4b0d69..f413e0c212 100644 --- a/frontend/services/entities/hosts.ts +++ b/frontend/services/entities/hosts.ts @@ -218,7 +218,7 @@ export default { const { HOSTS_DELETE } = endpoints; return sendRequest("POST", HOSTS_DELETE, { filters: { - query, + query: query || undefined, // Prevents empty string passed to API which as of 4.47 will return an error status, label_id: labelId, team_id: teamId, @@ -441,7 +441,7 @@ export default { return sendRequest("POST", HOSTS_TRANSFER_BY_FILTER, { team_id: teamId, filters: { - query, + query: query || undefined, // Prevents empty string passed to API which as of 4.47 will return an error status, label_id: labelId, team_id: currentTeam,