Closed as not planned
Closed as not planned
Description
Spotted in: #5060 (comment)
When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: ""
, it isn't possible as the API considers it as "no change". On the other hand, a user can set the icon field, but calling the CLI: coder templates edit <template-name>
will simply remove the icon.
The suggested solution would be to distinguish these actions:
- delete the field: field
""
is present in the JSON request - leave as is: field is not present in the request
- modify the field: non-empty field is present in the request
It implicates that CreateTemplateRequest and UpdateTemplateMeta should either contain nillable fields or we need to redesign that contract (API can receive a set of modify-actions).
Let me know your thoughts!