Able to edit thumbnail on update meta api

This commit is contained in:
LittleSheep 2024-12-26 22:35:39 +08:00
parent 243dbfa9c2
commit 303f8a36f1

View File

@ -91,6 +91,7 @@ func updateAttachmentMeta(c *fiber.Ctx) error {
var data struct { var data struct {
Alternative *string `json:"alt"` Alternative *string `json:"alt"`
Thumbnail *string `json:"thumbnail"`
Metadata *map[string]any `json:"metadata"` Metadata *map[string]any `json:"metadata"`
IsIndexable *bool `json:"is_indexable"` IsIndexable *bool `json:"is_indexable"`
} }
@ -107,6 +108,9 @@ func updateAttachmentMeta(c *fiber.Ctx) error {
if data.Alternative != nil { if data.Alternative != nil {
attachment.Alternative = *data.Alternative attachment.Alternative = *data.Alternative
} }
if data.Thumbnail != nil {
attachment.Thumbnail = *data.Thumbnail
}
if data.Metadata != nil { if data.Metadata != nil {
attachment.Usermeta = *data.Metadata attachment.Usermeta = *data.Metadata
} }