diff --git a/src/http.rs b/src/http.rs index 598038a..5b1eb1f 100644 --- a/src/http.rs +++ b/src/http.rs @@ -259,10 +259,14 @@ async fn reports(State(state): State>>) -> impl IntoResponse async fn report( State(state): State>>, - Path(id): Path, + Path(id): Path, ) -> impl IntoResponse { let lock = state.lock().expect("Failed to lock app state"); - if let Some(report) = lock.reports.get(id) { + if let Some(report) = lock + .reports + .iter() + .find(|r| *r.report_metadata.report_id == id) + { let report_json = serde_json::to_string(report).expect("Failed to serialize JSON"); ( StatusCode::OK, diff --git a/ui/index.html b/ui/index.html index 23fea98..e738fdd 100644 --- a/ui/index.html +++ b/ui/index.html @@ -101,6 +101,8 @@

Reports

+
+