(
State(state): State<AppState>,
headers: HeaderMap,
Path(mod_id): Path<String>,
)
| 389 | ) -> Result<Json<ModCatalogEntry>, StatusCode> { |
| 390 | match state |
| 391 | .service |
| 392 | .get_mod(&mod_id) |
| 393 | .await |
| 394 | .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)? |
| 395 | { |
| 396 | Some(mut entry) => { |
| 397 | absolutize_download_url( |
| 398 | &mut entry.download_url, |
| 399 | request_base_url(&headers).as_deref(), |
| 400 | ); |
| 401 | Ok(Json(entry)) |
| 402 | } |
| 403 | None => Err(StatusCode::NOT_FOUND), |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | #[utoipa::path( |
| 408 | get, |
| 409 | path = "/v1/mods/{modId}/versions", |
nothing calls this directly
no test coverage detected