mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Make template name editable (#3538)
This commit is contained in:
@@ -880,6 +880,7 @@ func (q *fakeQuerier) UpdateTemplateMetaByID(_ context.Context, arg database.Upd
|
||||
continue
|
||||
}
|
||||
tpl.UpdatedAt = database.Now()
|
||||
tpl.Name = arg.Name
|
||||
tpl.Description = arg.Description
|
||||
tpl.MaxTtl = arg.MaxTtl
|
||||
tpl.MinAutostartInterval = arg.MinAutostartInterval
|
||||
|
||||
@@ -2119,7 +2119,8 @@ SET
|
||||
updated_at = $2,
|
||||
description = $3,
|
||||
max_ttl = $4,
|
||||
min_autostart_interval = $5
|
||||
min_autostart_interval = $5,
|
||||
name = $6
|
||||
WHERE
|
||||
id = $1
|
||||
RETURNING
|
||||
@@ -2132,6 +2133,7 @@ type UpdateTemplateMetaByIDParams struct {
|
||||
Description string `db:"description" json:"description"`
|
||||
MaxTtl int64 `db:"max_ttl" json:"max_ttl"`
|
||||
MinAutostartInterval int64 `db:"min_autostart_interval" json:"min_autostart_interval"`
|
||||
Name string `db:"name" json:"name"`
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) UpdateTemplateMetaByID(ctx context.Context, arg UpdateTemplateMetaByIDParams) error {
|
||||
@@ -2141,6 +2143,7 @@ func (q *sqlQuerier) UpdateTemplateMetaByID(ctx context.Context, arg UpdateTempl
|
||||
arg.Description,
|
||||
arg.MaxTtl,
|
||||
arg.MinAutostartInterval,
|
||||
arg.Name,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ SET
|
||||
updated_at = $2,
|
||||
description = $3,
|
||||
max_ttl = $4,
|
||||
min_autostart_interval = $5
|
||||
min_autostart_interval = $5,
|
||||
name = $6
|
||||
WHERE
|
||||
id = $1
|
||||
RETURNING
|
||||
|
||||
Reference in New Issue
Block a user