Fix resetting list, label & namespace colors
This commit is contained in:
parent
47d7e713af
commit
24c1098736
3 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue