diff options
| author | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-03 20:36:59 +0300 |
|---|---|---|
| committer | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-03 20:36:59 +0300 |
| commit | fcde5ad4541832aca6c286ef4303c6d6a43f0a8d (patch) | |
| tree | bcb07401d05bca0dbe0d63effd744f3ec95b2c40 /src | |
| parent | fd0d45b98ec1136aeb84fc28fa647df9023abf75 (diff) | |
| download | genenetwork4-fcde5ad4541832aca6c286ef4303c6d6a43f0a8d.tar.gz | |
Fix RequestId import in routes modules: the extractor type is
tower_http::request_id::RequestId, not axum::http::RequestId.
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/groups.rs | 7 | ||||
| -rw-r--r-- | src/routes/species.rs | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/routes/groups.rs b/src/routes/groups.rs index ad1c089..7bf1710 100644 --- a/src/routes/groups.rs +++ b/src/routes/groups.rs @@ -2,6 +2,7 @@ //! InbredSet table and its strains. use axum::extract::{Extension, Path, Query}; +use tower_http::request_id::RequestId; use axum::http::StatusCode; use axum::Json; @@ -13,7 +14,7 @@ use crate::request_id_string; (status = 200, description = "All groups (InbredSet rows) in the database", body = Vec<db::Group>), (status = 500, description = "Database error", body = ApiError) ))] -pub async fn groups(Extension(request_id): Extension<axum::http::RequestId>) -> Result<Json<Vec<db::Group>>, ApiError> { +pub async fn groups(Extension(request_id): Extension<RequestId>) -> Result<Json<Vec<db::Group>>, ApiError> { let rid = request_id_string(&request_id); tokio::task::spawn_blocking(db::get_all_groups) .await @@ -48,7 +49,7 @@ pub async fn groups(Extension(request_id): Extension<axum::http::RequestId>) -> (status = 500, description = "Database error", body = ApiError) ))] pub async fn group_by_name( - Extension(request_id): Extension<axum::http::RequestId>, + Extension(request_id): Extension<RequestId>, Path(group): Path<String>, ) -> Result<Json<db::GroupDetail>, ApiError> { let rid = request_id_string(&request_id); @@ -103,7 +104,7 @@ pub struct GroupStrainsParams { (status = 500, description = "Database error", body = ApiError) ))] pub async fn group_strains( - Extension(request_id): Extension<axum::http::RequestId>, + Extension(request_id): Extension<RequestId>, Path(group): Path<String>, Query(params): Query<GroupStrainsParams>, ) -> Result<Json<Vec<db::Strain>>, ApiError> { diff --git a/src/routes/species.rs b/src/routes/species.rs index 29957ec..682fac0 100644 --- a/src/routes/species.rs +++ b/src/routes/species.rs @@ -1,6 +1,7 @@ //! Species domain endpoints: read-only access to the Species table. use axum::extract::{Extension, Path}; +use tower_http::request_id::RequestId; use axum::http::StatusCode; use axum::Json; @@ -12,7 +13,7 @@ use crate::request_id_string; (status = 200, description = "All species in the database", body = Vec<db::Species>), (status = 500, description = "Database error", body = ApiError) ))] -pub async fn species(Extension(request_id): Extension<axum::http::RequestId>) -> Result<Json<Vec<db::Species>>, ApiError> { +pub async fn species(Extension(request_id): Extension<RequestId>) -> Result<Json<Vec<db::Species>>, ApiError> { let rid = request_id_string(&request_id); // mysql's Conn is blocking; run it on a blocking thread so it doesn't // stall the async runtime. @@ -49,7 +50,7 @@ pub async fn species(Extension(request_id): Extension<axum::http::RequestId>) -> (status = 500, description = "Database error", body = ApiError) ))] pub async fn species_by_name( - Extension(request_id): Extension<axum::http::RequestId>, + Extension(request_id): Extension<RequestId>, Path(species): Path<String>, ) -> Result<Json<db::SpeciesDetail>, ApiError> { let rid = request_id_string(&request_id); |
