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") Icon("thumb-tack")
a.thread-link-title(href="/thread/" + thread.ID)= thread.Title a.thread-link-title(href="/thread/" + thread.ID)= thread.Title
.spacer .spacer
.thread-reply-count= len(thread.Posts) .thread-reply-count= len(thread.PostIDs)
.thread-icons .thread-icons
Icon(arn.GetForumIcon(thread.Tags[0])) Icon(arn.GetForumIcon(thread.Tags[0]))

View File

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

View File

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