Updated PreconditionFailed status occurences to more appropriate statuses. (#5513)

This commit is contained in:
Ben A
2023-01-13 14:30:48 +00:00
committed by GitHub
parent 967d25fdf7
commit 54cc587dad
15 changed files with 37 additions and 37 deletions

View File

@ -110,7 +110,7 @@ func (api *API) deleteTemplate(rw http.ResponseWriter, r *http.Request) {
return
}
if len(workspaces) > 0 {
httpapi.Write(ctx, rw, http.StatusPreconditionFailed, codersdk.Response{
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "All workspaces must be deleted before a template can be removed.",
})
return