Add maud for frontend and move api to sub module

This commit is contained in:
2023-06-01 00:03:00 -04:00
parent 9059894021
commit 1698ef9c60
10 changed files with 58 additions and 10 deletions

View File

@@ -0,0 +1,9 @@
use axum::{extract::State, Json};
use sqlx::PgPool;
use crate::error::Error;
use crate::models::entry::{get_entries, Entry};
pub async fn get(State(pool): State<PgPool>) -> Result<Json<Vec<Entry>>, Error> {
Ok(Json(get_entries(&pool).await?))
}