Skip to content

Commit b80d995

Browse files
authored
chore: revert status code change for delete users endpoint (#14168)
Revert from #13870
1 parent 4e0cb60 commit b80d995

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

coderd/apidoc/docs.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/users.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) {
513513
// @Security CoderSessionToken
514514
// @Tags Users
515515
// @Param user path string true "User ID, name, or me"
516-
// @Success 204
516+
// @Success 200
517517
// @Router /users/{user} [delete]
518518
func (api *API) deleteUser(rw http.ResponseWriter, r *http.Request) {
519519
ctx := r.Context()
@@ -588,7 +588,9 @@ func (api *API) deleteUser(rw http.ResponseWriter, r *http.Request) {
588588
}
589589
}
590590

591-
rw.WriteHeader(http.StatusNoContent)
591+
httpapi.Write(ctx, rw, http.StatusOK, codersdk.Response{
592+
Message: "User has been deleted!",
593+
})
592594
}
593595

594596
// Returns the parameterized user requested. All validation

codersdk/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ 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.StatusNoContent {
312+
if res.StatusCode != http.StatusOK {
313313
return ReadBodyAsError(res)
314314
}
315315
return nil

docs/api/users.md

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy