Function
get_users
(ThinData(db_pool): web::ThinData<Pool>)
Source from the content-addressed store, hash-verified
| 17 | use self::{errors::MyError, models::User}; |
| 18 | |
| 19 | pub async fn get_users(ThinData(db_pool): web::ThinData<Pool>) -> Result<HttpResponse, Error> { |
| 20 | let client: Client = db_pool.get().await.map_err(MyError::PoolError)?; |
| 21 | |
| 22 | let users = db::get_users(&client).await?; |
| 23 | |
| 24 | Ok(HttpResponse::Ok().json(users)) |
| 25 | } |
| 26 | |
| 27 | pub async fn add_user( |
| 28 | user: web::Json<User>, |
Callers
nothing calls this directly
Tested by
no test coverage detected