From 303f8a36f1c8f299fa335cdd3844c8d2eb2becde Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 26 Dec 2024 22:35:39 +0800 Subject: [PATCH] :sparkles: Able to edit thumbnail on update meta api --- pkg/internal/server/api/attachments_api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/internal/server/api/attachments_api.go b/pkg/internal/server/api/attachments_api.go index f12a960..9e1b582 100644 --- a/pkg/internal/server/api/attachments_api.go +++ b/pkg/internal/server/api/attachments_api.go @@ -91,6 +91,7 @@ func updateAttachmentMeta(c *fiber.Ctx) error { var data struct { Alternative *string `json:"alt"` + Thumbnail *string `json:"thumbnail"` Metadata *map[string]any `json:"metadata"` IsIndexable *bool `json:"is_indexable"` } @@ -107,6 +108,9 @@ func updateAttachmentMeta(c *fiber.Ctx) error { if data.Alternative != nil { attachment.Alternative = *data.Alternative } + if data.Thumbnail != nil { + attachment.Thumbnail = *data.Thumbnail + } if data.Metadata != nil { attachment.Usermeta = *data.Metadata }