Files
crawlnicle/src/handlers/entries.rs
Tyler Hallada 4eee21caed Switch to tailwind for css styling
Could use more partials to reduce some of the current repetition (especially forms), but this is a start with everything converted.
2024-01-07 19:45:20 -05:00

16 lines
421 B
Rust

use axum::extract::{Query, State};
use maud::Markup;
use sqlx::PgPool;
use crate::error::Result;
use crate::models::entry::{Entry, GetEntriesOptions};
use crate::partials::entry_list::entry_list;
pub async fn get(
Query(options): Query<GetEntriesOptions>,
State(pool): State<PgPool>,
) -> Result<Markup> {
let entries = Entry::get_all(&pool, &options).await?;
Ok(entry_list(entries, &options, false))
}