🐛 Fix uuid duplicate when link exists

This commit is contained in:
2024-05-18 22:26:00 +08:00
parent 4607e18fb3
commit a5a6503af9
2 changed files with 5 additions and 3 deletions

View File

@ -50,6 +50,7 @@ func NewAttachmentMetadata(tx *gorm.DB, user models.Account, file *multipart.Fil
linked = true
attachment = exists
attachment.ID = 0
attachment.Uuid = uuid.NewString()
attachment.AccountID = user.ID
} else {
// Upload the new file