diff --git a/pkg/internal/models/posts.go b/pkg/internal/models/posts.go index e19ad0c..8235269 100644 --- a/pkg/internal/models/posts.go +++ b/pkg/internal/models/posts.go @@ -62,17 +62,17 @@ type Post struct { } type PostStoryBody struct { - Thumbnail *uint `json:"thumbnail"` - Title *string `json:"title"` - Content string `json:"content"` - Location *string `json:"location"` - Attachments []uint `json:"attachments"` + Thumbnail *uint `json:"thumbnail"` + Title *string `json:"title"` + Content string `json:"content"` + Location *string `json:"location"` + Attachments []string `json:"attachments"` } type PostArticleBody struct { - Thumbnail *uint `json:"thumbnail"` - Title string `json:"title"` - Description *string `json:"description"` - Content string `json:"content"` - Attachments []uint `json:"attachments"` + Thumbnail *uint `json:"thumbnail"` + Title string `json:"title"` + Description *string `json:"description"` + Content string `json:"content"` + Attachments []string `json:"attachments"` } diff --git a/pkg/internal/server/api/articles_api.go b/pkg/internal/server/api/articles_api.go index b23556e..44d779c 100644 --- a/pkg/internal/server/api/articles_api.go +++ b/pkg/internal/server/api/articles_api.go @@ -26,7 +26,7 @@ func createArticle(c *fiber.Ctx) error { Description *string `json:"description"` Content string `json:"content" validate:"required"` Thumbnail *uint `json:"thumbnail"` - Attachments []uint `json:"attachments"` + Attachments []string `json:"attachments"` Tags []models.Tag `json:"tags"` Categories []models.Category `json:"categories"` PublishedAt *time.Time `json:"published_at"` @@ -111,7 +111,7 @@ func editArticle(c *fiber.Ctx) error { Description *string `json:"description"` Content string `json:"content" validate:"required"` Thumbnail *uint `json:"thumbnail"` - Attachments []uint `json:"attachments"` + Attachments []string `json:"attachments"` Tags []models.Tag `json:"tags"` Categories []models.Category `json:"categories"` PublishedAt *time.Time `json:"published_at"` diff --git a/pkg/internal/server/api/stories_api.go b/pkg/internal/server/api/stories_api.go index 18ef3e0..f532d7c 100644 --- a/pkg/internal/server/api/stories_api.go +++ b/pkg/internal/server/api/stories_api.go @@ -26,7 +26,7 @@ func createStory(c *fiber.Ctx) error { Content string `json:"content" validate:"required,max=4096"` Location *string `json:"location"` Thumbnail *uint `json:"thumbnail"` - Attachments []uint `json:"attachments"` + Attachments []string `json:"attachments"` Tags []models.Tag `json:"tags"` Categories []models.Category `json:"categories"` PublishedAt *time.Time `json:"published_at"` @@ -130,7 +130,7 @@ func editStory(c *fiber.Ctx) error { Content string `json:"content" validate:"required,max=4096"` Thumbnail *uint `json:"thumbnail"` Location *string `json:"location"` - Attachments []uint `json:"attachments"` + Attachments []string `json:"attachments"` Tags []models.Tag `json:"tags"` Categories []models.Category `json:"categories"` PublishedAt *time.Time `json:"published_at"`