fix: Allow to stop or remove workspaces using rich and old parameters (#6099)

* fix: Allow to stop or remove workspaces using rich and old parameters

* Fix
This commit is contained in:
Marcin Tojek
2023-02-08 21:09:52 +01:00
committed by GitHub
parent 1617268859
commit fe725f76bb

View File

@ -518,7 +518,8 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
return
}
if len(legacyParameters) > 0 && len(parameters) > 0 {
if createBuild.Transition == codersdk.WorkspaceTransitionStart &&
len(legacyParameters) > 0 && len(parameters) > 0 {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Rich parameters can't be used together with legacy parameters.",
})