feat(site): Ask for version name and if it is active when publishing a new version on editor (#6756)

This commit is contained in:
Bruno Quaresma
2023-03-27 14:26:57 -03:00
committed by GitHub
parent b439c3e167
commit dd4e1f74ff
11 changed files with 651 additions and 248 deletions

View File

@ -123,6 +123,9 @@ func (api *API) patchTemplateVersion(rw http.ResponseWriter, r *http.Request) {
if errors.Is(err, errTemplateVersionNameConflict) {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: err.Error(),
Validations: []codersdk.ValidationError{
{Field: "name", Detail: "Name is already used"},
},
})
return
}