diff --git a/pkg/internal/server/api/posts_api.go b/pkg/internal/server/api/posts_api.go index d1beae0..05246c0 100644 --- a/pkg/internal/server/api/posts_api.go +++ b/pkg/internal/server/api/posts_api.go @@ -22,6 +22,13 @@ func getPost(c *fiber.Ctx) error { var err error tx := services.FilterPostDraft(database.C) + + if user, authenticated := c.Locals("user").(models.Account); authenticated { + tx = services.FilterPostWithUserContext(tx, &user) + } else { + tx = services.FilterPostWithUserContext(tx, nil) + } + if numericId, paramErr := strconv.Atoi(id); paramErr == nil { item, err = services.GetPost(tx, uint(numericId)) } else {