summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-10-24 10:18:24 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-10-24 12:02:00 +0200
commitac0f83ae012b3eeb3c05d5a04d5f80fc1f7b2af7 (patch)
tree064aae7bea66404dc2048eaf0426a21325df7e40
parent393ff04ff4a3cfd944e08e62bdda133dc1e5e3da (diff)
Pass DbPool to handler fn
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--service-person/src/main.rs2
1 files changed, 1 insertions, 1 deletions
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<Person>) -> Result<HttpResponse> {
+async fn create_person(db: web::Data<DbPool>, person: web::Json<Person>) -> Result<HttpResponse> {
log::debug!("Creating person = {:?}", person);
Ok(HttpResponse::Ok().finish())
}