Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b55a7a8

Browse files
Emyrkaslilac
andauthored
chore: delete user codersdk to support status code regression (#14173)
* chore: delete user codersdk to support status code regression * Update codersdk/users.go Co-authored-by: Kayla Washburn-Love <[email protected]> --------- Co-authored-by: Kayla Washburn-Love <[email protected]>
1 parent 8c05651 commit b55a7a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codersdk/users.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ func (c *Client) DeleteUser(ctx context.Context, id uuid.UUID) error {
309309
return err
310310
}
311311
defer res.Body.Close()
312-
if res.StatusCode != http.StatusOK {
312+
// Check for a 200 or a 204 response. 2.14.0 accidentally included a 204 response,
313+
// which was a breaking change, and reverted in 2.14.1.
314+
if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusNoContent {
313315
return ReadBodyAsError(res)
314316
}
315317
return nil

0 commit comments

Comments
 (0)