(
invitation_id: web::Path<String>,
user_data: web::Json<UserData>,
pool: web::Data<Pool>,
)
| 16 | } |
| 17 | |
| 18 | pub async fn register_user( |
| 19 | invitation_id: web::Path<String>, |
| 20 | user_data: web::Json<UserData>, |
| 21 | pool: web::Data<Pool>, |
| 22 | ) -> Result<HttpResponse, actix_web::Error> { |
| 23 | let user = web::block(move || { |
| 24 | query( |
| 25 | invitation_id.into_inner(), |
| 26 | user_data.into_inner().password, |
| 27 | pool, |
| 28 | ) |
| 29 | }) |
| 30 | .await??; |
| 31 | |
| 32 | Ok(HttpResponse::Ok().json(&user)) |
| 33 | } |
| 34 | |
| 35 | fn query( |
| 36 | invitation_id: String, |