Implement entry and feed pagination

This commit is contained in:
2023-09-02 14:01:18 -04:00
parent 0607b46283
commit ec394fc170
29 changed files with 520 additions and 158 deletions

View File

@@ -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))
}
}))
}