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

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

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/users.go

+4-2
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

+1-1
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

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)