(
State(state): State<Arc<AppState>>,
Path(contract_app_data): Path<AppDataHash>,
)
| 10 | }; |
| 11 | |
| 12 | pub async fn get_app_data_handler( |
| 13 | State(state): State<Arc<AppState>>, |
| 14 | Path(contract_app_data): Path<AppDataHash>, |
| 15 | ) -> Response { |
| 16 | let result = state |
| 17 | .database_read |
| 18 | .get_full_app_data(&contract_app_data) |
| 19 | .await; |
| 20 | match result { |
| 21 | Ok(Some(response)) => ( |
| 22 | StatusCode::OK, |
| 23 | Json(AppDataDocument { |
| 24 | full_app_data: response, |
| 25 | }), |
| 26 | ) |
| 27 | .into_response(), |
| 28 | Ok(None) => (StatusCode::NOT_FOUND, "full app data not found").into_response(), |
| 29 | Err(err) => { |
| 30 | tracing::error!(?err, "get_app_data_by_hash"); |
| 31 | crate::api::internal_error_reply() |
| 32 | } |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected