Hide articles on public pages

Only show them in the dashboard
This commit is contained in:
Bat
2018-09-10 20:06:00 +01:00
parent 8879935925
commit 10da8f31b6
4 changed files with 40 additions and 3 deletions
+2 -1
View File
@@ -105,7 +105,8 @@ fn dashboard(user: User, conn: DbConn) -> Template {
let blogs = Blog::find_for_author(&*conn, user.id);
Template::render("users/dashboard", json!({
"account": user.to_json(&*conn),
"blogs": blogs
"blogs": blogs,
"drafts": Post::drafts_by_author(&*conn, &user).into_iter().map(|a| a.to_json(&*conn)).collect::<Vec<serde_json::Value>>(),
}))
}