mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 18:24:10 +02:00
typo
This commit is contained in:
parent
781bd03ad2
commit
1d0d8fda57
1 changed files with 6 additions and 21 deletions
|
|
@ -27,8 +27,8 @@ enum ApiError {
|
||||||
SteamId(#[from] SteamIDError),
|
SteamId(#[from] SteamIDError),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Scrape(#[from] ScrapeError),
|
Scrape(#[from] ScrapeError),
|
||||||
#[error("mallformed request")]
|
#[error("malformed request")]
|
||||||
Mallformared(String),
|
Malformed(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoResponse for ApiError {
|
impl IntoResponse for ApiError {
|
||||||
|
|
@ -38,7 +38,7 @@ impl IntoResponse for ApiError {
|
||||||
Self::SteamId(err) => {
|
Self::SteamId(err) => {
|
||||||
(StatusCode::UNPROCESSABLE_ENTITY, format!("{:#}", err)).into_response()
|
(StatusCode::UNPROCESSABLE_ENTITY, format!("{:#}", err)).into_response()
|
||||||
}
|
}
|
||||||
Self::Mallformared(err) => {
|
Self::Malformed(err) => {
|
||||||
(StatusCode::UNPROCESSABLE_ENTITY, format!("{:#}", err)).into_response()
|
(StatusCode::UNPROCESSABLE_ENTITY, format!("{:#}", err)).into_response()
|
||||||
}
|
}
|
||||||
Self::Scrape(ScrapeError::NotFound) => (StatusCode::NOT_FOUND, "").into_response(),
|
Self::Scrape(ScrapeError::NotFound) => (StatusCode::NOT_FOUND, "").into_response(),
|
||||||
|
|
@ -116,12 +116,7 @@ async fn teams(
|
||||||
) -> Result<impl IntoResponse, ApiError> {
|
) -> Result<impl IntoResponse, ApiError> {
|
||||||
let mode = match GameMode::from_str(&format) {
|
let mode = match GameMode::from_str(&format) {
|
||||||
Ok(mode) => mode,
|
Ok(mode) => mode,
|
||||||
_ => {
|
_ => return Err(ApiError::Malformed(format!("invalid game mode {}", format))),
|
||||||
return Err(ApiError::Mallformared(format!(
|
|
||||||
"invalid game mode {}",
|
|
||||||
format
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let response = state.client.teams(mode).await?;
|
let response = state.client.teams(mode).await?;
|
||||||
Ok(Json(response))
|
Ok(Json(response))
|
||||||
|
|
@ -134,12 +129,7 @@ async fn transactions(
|
||||||
) -> Result<impl IntoResponse, ApiError> {
|
) -> Result<impl IntoResponse, ApiError> {
|
||||||
let mode = match GameMode::from_str(&format) {
|
let mode = match GameMode::from_str(&format) {
|
||||||
Ok(mode) => mode,
|
Ok(mode) => mode,
|
||||||
_ => {
|
_ => return Err(ApiError::Malformed(format!("invalid game mode {}", format))),
|
||||||
return Err(ApiError::Mallformared(format!(
|
|
||||||
"invalid game mode {}",
|
|
||||||
format
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let response = state.client.transactions(mode).await?;
|
let response = state.client.transactions(mode).await?;
|
||||||
Ok(Json(response))
|
Ok(Json(response))
|
||||||
|
|
@ -192,12 +182,7 @@ async fn map_history(
|
||||||
) -> Result<impl IntoResponse, ApiError> {
|
) -> Result<impl IntoResponse, ApiError> {
|
||||||
let mode = match GameMode::from_str(&format) {
|
let mode = match GameMode::from_str(&format) {
|
||||||
Ok(mode) => mode,
|
Ok(mode) => mode,
|
||||||
_ => {
|
_ => return Err(ApiError::Malformed(format!("invalid game mode {}", format))),
|
||||||
return Err(ApiError::Mallformared(format!(
|
|
||||||
"invalid game mode {}",
|
|
||||||
format
|
|
||||||
)))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let response = state.client.map_history(mode).await?;
|
let response = state.client.map_history(mode).await?;
|
||||||
Ok(Json(response))
|
Ok(Json(response))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue