fix: make cover image id actually updatable

This commit is contained in:
kolaente 2022-10-02 13:44:56 +02:00
parent 0e1904d50b
commit 0eb47096db
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -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...).