Sort posts by published dated descending

This commit is contained in:
Evie Viau-Chow-Stuart 2023-02-05 02:12:13 -08:00
parent c89b6e6754
commit 5715225050
Signed by: evie
GPG key ID: 928652CDFCEC8099

View file

@ -30,6 +30,7 @@ pub(crate) async fn posts(state: State<AppState>) -> impl IntoResponse {
let posts: Vec<post::Model> = Post::find()
.filter(post::Column::Draft.eq(false))
.order_by_desc(post::Column::Published)
.all(&state.db_conn)
.await
.expect("Failed to load posts!");