Implement entry and feed pagination
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use axum::response::Response;
|
||||
use maud::html;
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::error::Result;
|
||||
@@ -7,6 +8,11 @@ use crate::models::entry::Entry;
|
||||
use crate::partials::{layout::Layout, entry_list::entry_list};
|
||||
|
||||
pub async fn get(State(pool): State<PgPool>, layout: Layout) -> Result<Response> {
|
||||
let entries = Entry::get_all(&pool, Default::default()).await?;
|
||||
Ok(layout.render(entry_list(entries)))
|
||||
let options = Default::default();
|
||||
let entries = Entry::get_all(&pool, &options).await?;
|
||||
Ok(layout.render(html! {
|
||||
ul class="entries" {
|
||||
(entry_list(entries, &options))
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user