From d979f85f68aa21cda50f744c13bc5179fab959f0 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 29 Dec 2024 01:44:54 +0800 Subject: [PATCH] :bug: Fix re-upload still need in temp --- pkg/internal/services/uploader.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/internal/services/uploader.go b/pkg/internal/services/uploader.go index aab5b1f..f76a05f 100644 --- a/pkg/internal/services/uploader.go +++ b/pkg/internal/services/uploader.go @@ -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)