update
This commit is contained in:
parent
0be7fff77d
commit
74b07a0ea3
8 changed files with 107 additions and 10 deletions
|
@ -76,3 +76,18 @@ pub async fn inventory_route(
|
|||
.map(|x| x.api_json())
|
||||
.collect::<Vec<_>>()))
|
||||
}
|
||||
|
||||
#[get("/item/<item_id>/<variant_id>/stat")]
|
||||
pub async fn variant_stat_route(
|
||||
item_id: &str,
|
||||
variant_id: &str,
|
||||
itemdb: &State<ItemDB>,
|
||||
) -> FallibleApiResponse {
|
||||
let variant = itemdb
|
||||
.get_item(item_id)
|
||||
.ok_or_else(item_does_not_exist_error)?
|
||||
.variant(variant_id)
|
||||
.ok_or_else(variant_does_not_exist_error)?;
|
||||
|
||||
Ok(variant.stat().await)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue