From 6f38a8f9569138a55db1646ae5977f44fbca22c2 Mon Sep 17 00:00:00 2001 From: Kilerd Chan Date: Sat, 6 Oct 2018 23:27:20 +0800 Subject: [PATCH] feat: only show the published archives --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ccdb27f..f32c264 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ use rocket::response::Redirect; fn index(conn: DbConn) -> Template { let mut context = Context::new(); - let result = posts.load::(&*conn).expect("cannot load posts"); + let result = posts.filter(published.eq(true)).load::(&*conn).expect("cannot load posts"); context.add("posts", &result); println!("{:?}", result);