From ac0f83ae012b3eeb3c05d5a04d5f80fc1f7b2af7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 24 Oct 2021 10:18:24 +0200 Subject: Pass DbPool to handler fn Signed-off-by: Matthias Beyer --- service-person/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-person/src/main.rs b/service-person/src/main.rs index 3c5dc74..001888f 100644 --- a/service-person/src/main.rs +++ b/service-person/src/main.rs @@ -37,7 +37,7 @@ pub fn establish_connection() -> DbPool { .expect(&format!("Error connection to {}", database_url)) } -async fn create_person(person: web::Json) -> Result { +async fn create_person(db: web::Data, person: web::Json) -> Result { log::debug!("Creating person = {:?}", person); Ok(HttpResponse::Ok().finish()) } -- cgit v1.2.3