mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 18:24:10 +02:00
add match page
This commit is contained in:
parent
caf376ac42
commit
668edc434a
9 changed files with 3614 additions and 7 deletions
|
|
@ -64,6 +64,7 @@ async fn main() -> MainResult {
|
|||
.route("/team/:id", get(team))
|
||||
.route("/team/:id/roster", get(team_roster))
|
||||
.route("/team/:id/matches", get(team_matches))
|
||||
.route("/match/:id", get(match_page))
|
||||
.with_state(AppState::default());
|
||||
|
||||
// run it
|
||||
|
|
@ -150,3 +151,13 @@ async fn team_matches(
|
|||
let response = state.client.team_matches(id).await?;
|
||||
Ok(Json(response))
|
||||
}
|
||||
|
||||
#[instrument(skip(state))]
|
||||
async fn match_page(
|
||||
Path(id): Path<u32>,
|
||||
State(state): State<AppState>,
|
||||
) -> Result<impl IntoResponse, ApiError> {
|
||||
debug!(team = id, "requesting match");
|
||||
let response = state.client.match_info(id).await?;
|
||||
Ok(Json(response))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue