🐛 I am dumb

This commit is contained in:
2024-05-20 22:31:55 +08:00
parent ff450ddd9d
commit 2b131982b8
5 changed files with 16 additions and 10 deletions

View File

@@ -48,9 +48,11 @@ func NewAttachmentMetadata(tx *gorm.DB, user models.Account, file *multipart.Fil
exists, pickupErr := GetAttachmentByHash(attachment.HashCode)
if pickupErr == nil {
linked = true
exists.Alternative = attachment.Alternative
exists.Usage = attachment.Usage
exists.Metadata = attachment.Metadata
attachment = exists
attachment.ID = 0
attachment.Uuid = uuid.NewString()
attachment.AccountID = user.ID
} else {
// Upload the new file