Fix a bug on article page

This commit is contained in:
Bat 2018-07-26 19:08:18 +02:00
parent b42030e831
commit d4a8808f00

View File

@ -42,7 +42,7 @@ fn details_response(blog: String, slug: String, conn: DbConn, user: Option<User>
Template::render("posts/details", json!({ Template::render("posts/details", json!({
"author": post.get_authors(&*conn)[0].to_json(&*conn), "author": post.get_authors(&*conn)[0].to_json(&*conn),
"article": post.to_json(&*conn), "article": post.to_json(&*conn),
"blog": blog, "blog": blog.to_json(&*conn),
"comments": &comments.into_iter().filter_map(|c| if c.in_response_to_id.is_none() { "comments": &comments.into_iter().filter_map(|c| if c.in_response_to_id.is_none() {
Some(c.to_json(&*conn, &comms)) Some(c.to_json(&*conn, &comms))
} else { } else {