Removed Postable proxies

This commit is contained in:
2018-11-01 17:05:55 +09:00
parent ae1bd6846d
commit 4779b492ec
6 changed files with 20 additions and 28 deletions

View File

@ -23,18 +23,10 @@ func GetPostsByUser(ctx *aero.Context) string {
posts := viewUser.Posts()
arn.SortPostsLatestFirst(posts)
var postables []arn.Postable
if len(posts) >= postLimit {
posts = posts[:postLimit]
}
postables = make([]arn.Postable, len(posts))
for i, post := range posts {
postables[i] = arn.ToPostable(post)
}
return ctx.HTML(components.LatestPosts(postables, viewUser, utils.GetUser(ctx), ctx.URI()))
return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI()))
}