From b041ce3e067b4dc9965136b15d51a08f8003d2f9 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 29 Dec 2024 00:49:38 +0800 Subject: [PATCH] :bug: Fix attachment did not updated --- pkg/internal/services/attachments.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/internal/services/attachments.go b/pkg/internal/services/attachments.go index fc4ac6e..1739a74 100644 --- a/pkg/internal/services/attachments.go +++ b/pkg/internal/services/attachments.go @@ -190,7 +190,7 @@ func TryLinkAttachment(tx *gorm.DB, og models.Attachment, hash string) (bool, er } 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 } else { CacheAttachment(item)