🐛 Fix attachment did not updated
This commit is contained in:
parent
3eee9755d4
commit
b041ce3e06
@ -190,7 +190,7 @@ func TryLinkAttachment(tx *gorm.DB, og models.Attachment, hash string) (bool, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UpdateAttachment(item models.Attachment) (models.Attachment, error) {
|
func UpdateAttachment(item models.Attachment) (models.Attachment, error) {
|
||||||
if err := database.C.Model(&item).Updates(&item).Error; err != nil {
|
if err := database.C.Save(&item).Error; err != nil {
|
||||||
return item, err
|
return item, err
|
||||||
} else {
|
} else {
|
||||||
CacheAttachment(item)
|
CacheAttachment(item)
|
||||||
|
Loading…
Reference in New Issue
Block a user