Add a button to reshare

This commit is contained in:
Bat
2018-05-19 10:57:39 +01:00
parent 63eb1a7e98
commit 9b98a45f2e
3 changed files with 21 additions and 0 deletions
+2
View File
@@ -39,6 +39,8 @@ fn details(blog: String, slug: String, conn: DbConn, user: Option<User>) -> Temp
}).collect::<Vec<serde_json::Value>>(),
"n_likes": post.get_likes(&*conn).len(),
"has_liked": user.clone().map(|u| u.has_liked(&*conn, &post)).unwrap_or(false),
"n_reshares": post.get_reshares(&*conn).len(),
"has_reshared": user.clone().map(|u| u.has_reshared(&*conn, &post)).unwrap_or(false),
"account": user,
"date": &post.creation_date.timestamp()
}))