🐛 Fix re-upload still need in temp

This commit is contained in:
LittleSheep 2024-12-29 01:44:54 +08:00
parent 00fddfdef9
commit d979f85f68

View File

@ -36,12 +36,9 @@ func UploadFileToTemporary(ctx *fiber.Ctx, file *multipart.FileHeader, meta mode
}
func ReUploadFile(meta models.Attachment, dst int) error {
if dst == models.AttachmentDstTemporary || meta.Destination == dst {
if meta.Destination == dst {
return fmt.Errorf("destnation cannot be reversed temporary or the same as the original")
}
if meta.Destination != models.AttachmentDstTemporary {
return fmt.Errorf("attachment isn't in temporary storage, unable to process")
}
prevDst := meta.Destination
inDst, err := fs.DownloadFileToLocal(meta, prevDst)