fix: make cover image id actually updatable
This commit is contained in:
parent
0e1904d50b
commit
0eb47096db
1 changed files with 5 additions and 1 deletions
|
@ -1042,7 +1042,7 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
|
|||
"position",
|
||||
"repeat_mode",
|
||||
"kanban_position",
|
||||
"cover_image_attachment_id",
|
||||
"cover_image_attachment_id", // TODO: check if the attachment belongs to the task
|
||||
}
|
||||
|
||||
// If the task is being moved between lists, make sure to move the bucket + index as well
|
||||
|
@ -1152,6 +1152,10 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
|
|||
if !t.IsFavorite {
|
||||
ot.IsFavorite = false
|
||||
}
|
||||
// Attachment cover image
|
||||
if t.CoverImageAttachmentID == 0 {
|
||||
ot.CoverImageAttachmentID = 0
|
||||
}
|
||||
|
||||
_, err = s.ID(t.ID).
|
||||
Cols(colsToUpdate...).
|
||||
|
|
Loading…
Reference in a new issue