Updated to latest arn API

This commit is contained in:
Eduard Urbach 2018-10-29 09:15:45 +09:00
parent 681177b28e
commit 9aa3d9de62
3 changed files with 4 additions and 8 deletions

View File

@ -8,6 +8,6 @@ component ThreadLink(thread *arn.Thread)
Icon("thumb-tack")
a.thread-link-title(href="/thread/" + thread.ID)= thread.Title
.spacer
.thread-reply-count= len(thread.Posts)
.thread-reply-count= len(thread.PostIDs)
.thread-icons
Icon(arn.GetForumIcon(thread.Tags[0]))

View File

@ -22,12 +22,7 @@ func Get(ctx *aero.Context) string {
}
// Fetch posts
postObjects := arn.DB.GetMany("Post", thread.Posts)
posts := make([]*arn.Post, len(postObjects))
for i, obj := range postObjects {
posts[i] = obj.(*arn.Post)
}
posts := thread.Posts()
// Sort posts
arn.SortPostsLatestLast(posts)

View File

@ -63,7 +63,8 @@ export function forumReply(arn: AnimeNotifier) {
let post = {
text: textarea.value,
threadId: thread.dataset.id,
parentId: thread.dataset.id,
parentType: "Thread",
tags: []
}