feat: only show the published archives

This commit is contained in:
Kilerd Chan 2018-10-06 23:27:20 +08:00
parent fc0f709b51
commit 6f38a8f956

View File

@ -34,7 +34,7 @@ use rocket::response::Redirect;
fn index(conn: DbConn) -> Template {
let mut context = Context::new();
let result = posts.load::<Post>(&*conn).expect("cannot load posts");
let result = posts.filter(published.eq(true)).load::<Post>(&*conn).expect("cannot load posts");
context.add("posts", &result);
println!("{:?}", result);