From a4e81cabec6a8c99a5b8314747d1561f5110a5a0 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 28 Dec 2024 19:26:46 +0800 Subject: [PATCH] :bug: Bug fixes --- pkg/internal/server/api/attachments_api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/internal/server/api/attachments_api.go b/pkg/internal/server/api/attachments_api.go index 9837a86..e11006e 100644 --- a/pkg/internal/server/api/attachments_api.go +++ b/pkg/internal/server/api/attachments_api.go @@ -132,6 +132,9 @@ func updateAttachmentMeta(c *fiber.Ctx) error { First(&compressed).Error; err != nil { return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable find compressed: %v", err)) } + if attachment.Compressed != nil { + services.UnsetAttachmentAsCompressed(*attachment.Compressed) + } compressed, err := services.SetAttachmentAsCompressed(compressed) if err != nil { return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable set compressed: %v", err))