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 <mckayla@hey.com>

---------

Co-authored-by: Kayla Washburn-Love <mckayla@hey.com>
This commit is contained in:
Steven Masley
2024-08-07 11:19:31 -05:00
committed by GitHub
parent 8c0565177e
commit b55a7a8b78

View File

@ -309,7 +309,9 @@ func (c *Client) DeleteUser(ctx context.Context, id uuid.UUID) error {
return err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
// Check for a 200 or a 204 response. 2.14.0 accidentally included a 204 response,
// which was a breaking change, and reverted in 2.14.1.
if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusNoContent {
return ReadBodyAsError(res)
}
return nil