diff --git a/pkg/models/label.go b/pkg/models/label.go index cb4aa8e92b..9f487e1be1 100644 --- a/pkg/models/label.go +++ b/pkg/models/label.go @@ -92,7 +92,14 @@ func (l *Label) Create(a web.Auth) (err error) { // @Failure 500 {object} models.Message "Internal error" // @Router /labels/{id} [put] func (l *Label) Update() (err error) { - _, err = x.ID(l.ID).Update(l) + _, err = x. + ID(l.ID). + Cols( + "title", + "description", + "hex_color", + ). + Update(l) if err != nil { return } diff --git a/pkg/models/list.go b/pkg/models/list.go index 7195b8e456..2a6b1b7763 100644 --- a/pkg/models/list.go +++ b/pkg/models/list.go @@ -460,13 +460,11 @@ func CreateOrUpdateList(list *List) (err error) { "title", "is_archived", "identifier", + "hex_color", } if list.Description != "" { colsToUpdate = append(colsToUpdate, "description") } - if list.HexColor != "" { - colsToUpdate = append(colsToUpdate, "hex_color") - } _, err = x. ID(list.ID). diff --git a/pkg/models/namespace.go b/pkg/models/namespace.go index 4d841acbff..c9453f9bcd 100644 --- a/pkg/models/namespace.go +++ b/pkg/models/namespace.go @@ -448,13 +448,11 @@ func (n *Namespace) Update() (err error) { colsToUpdate := []string{ "name", "is_archived", + "hex_color", } if n.Description != "" { colsToUpdate = append(colsToUpdate, "description") } - if n.HexColor != "" { - colsToUpdate = append(colsToUpdate, "hex_color") - } // Do the actual update _, err = x.