chore: deprecate template create command in favor of template push (#11390)

This commit is contained in:
Garrett Delfosse
2024-01-05 16:04:14 -05:00
committed by GitHub
parent 3d54bc06f6
commit b21da38bea
42 changed files with 498 additions and 420 deletions

View File

@ -667,6 +667,11 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
name = template.Name
}
groupACL := template.GroupACL
if req.DisableEveryoneGroupAccess {
groupACL = database.TemplateACL{}
}
var err error
err = tx.UpdateTemplateMetaByID(ctx, database.UpdateTemplateMetaByIDParams{
ID: template.ID,
@ -676,6 +681,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
Description: req.Description,
Icon: req.Icon,
AllowUserCancelWorkspaceJobs: req.AllowUserCancelWorkspaceJobs,
GroupACL: groupACL,
})
if err != nil {
return xerrors.Errorf("update template metadata: %w", err)