Function
add_user
(
user: web::Json<User>,
ThinData(db_pool): web::ThinData<Pool>,
)
Source from the content-addressed store, hash-verified
| 25 | } |
| 26 | |
| 27 | pub async fn add_user( |
| 28 | user: web::Json<User>, |
| 29 | ThinData(db_pool): web::ThinData<Pool>, |
| 30 | ) -> Result<HttpResponse, Error> { |
| 31 | let user_info: User = user.into_inner(); |
| 32 | |
| 33 | let client: Client = db_pool.get().await.map_err(MyError::PoolError)?; |
| 34 | |
| 35 | let new_user = db::add_user(&client, user_info).await?; |
| 36 | |
| 37 | Ok(HttpResponse::Ok().json(new_user)) |
| 38 | } |
| 39 | |
| 40 | #[actix_web::main] |
| 41 | async fn main() -> std::io::Result<()> { |
Callers
nothing calls this directly
Tested by
no test coverage detected