diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-08-22 17:04:48 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-08-22 17:04:48 +0200 |
commit | bb186c0d67139f076ca8ec1aa99ac0841b3036f3 (patch) | |
tree | 16d7b46a53527fed2ab6fbbd1ab6f421311c514e /server/src/main.rs | |
parent | 78c3d9f61e2087cd09fdd36f002f910a4394c7f3 (diff) |
Get all users
Diffstat (limited to 'server/src/main.rs')
-rw-r--r-- | server/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index 3b080eb..8319fb2 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,6 +1,7 @@ mod db; mod errors; mod logger; +mod models; use axum::{ http::{header, Request}, @@ -52,8 +53,9 @@ async fn create_app() -> Router { } // Example root which says hi -async fn hej() -> Result<Json<Hej>, errors::AppError> { - Ok(Json(Hej::new("hej verden".to_string()))) +async fn hej() -> Result<Json<Vec<models::users::User>>, errors::AppError> { + let users = models::users::User::list().await?; + Ok(Json(users)) } #[derive(Debug, Serialize)] |