From e2d2ed4cec03baedf2386a608a69f5bcce3b55bb Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Fri, 20 Feb 2026 10:27:00 -0600 Subject: [PATCH] Fix adding/modifying enroll secrets in UI (#40180) **Related issue:** Resolves #40170 # Details Fixes an unreleased issue where when attempting to modify a fleet enroll secret, you get a 400 response indicating that both team_id and fleet_id params are being sent. The request was piping the "get enroll secrets" response back into the "modify enroll secrets" # Checklist for submitter If some of the following don't apply, delete the relevant line. - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. n/a, unreleased bug ## Testing - [ ] Added/updated automated tests - [X] QA'd all new/changed functionality manually On main: reproduced issue when attempting to add secret to a fleet On branch: secret added successfully For unreleased bug fixes in a release candidate, one of: - [X] Confirmed that the fix is not expected to adversely impact load test results --- frontend/services/entities/teams.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/services/entities/teams.ts b/frontend/services/entities/teams.ts index 9a19eda16b..c463fd2bf3 100644 --- a/frontend/services/entities/teams.ts +++ b/frontend/services/entities/teams.ts @@ -210,9 +210,11 @@ export default { return sendRequest("GET", path); }, modifyEnrollSecrets: (teamId: number, secrets: IEnrollSecret[]) => { + // The API only expects an array of objects with a "secret" property. + const payload = secrets.map((s) => pick(s, "secret")); const { TEAMS_ENROLL_SECRETS } = endpoints; const path = TEAMS_ENROLL_SECRETS(teamId); - return sendRequest("PATCH", path, { secrets }); + return sendRequest("PATCH", path, { secrets: payload }); }, };