stat
This commit is contained in:
parent
58f5b1d93c
commit
f074727130
6 changed files with 101 additions and 22 deletions
|
@ -130,10 +130,11 @@ pub async fn inventory_route_variant(
|
|||
}
|
||||
|
||||
/// Returns statistics for the Item Variant
|
||||
#[get("/item/<item_id>/<variant_id>/stat")]
|
||||
#[get("/item/<item_id>/<variant_id>/stat?<full>")]
|
||||
pub async fn variant_stat_route(
|
||||
item_id: &str,
|
||||
variant_id: &str,
|
||||
full: Option<&str>,
|
||||
itemdb: &State<ItemDB>,
|
||||
t: Token,
|
||||
c: &State<Config>,
|
||||
|
@ -146,5 +147,7 @@ pub async fn variant_stat_route(
|
|||
.variant(variant_id)
|
||||
.ok_or_else(variant_does_not_exist_error)?;
|
||||
|
||||
Ok(variant.stat().await)
|
||||
Ok(variant
|
||||
.stat(full.map(|x| x == "1" || x == "true").unwrap_or(false))
|
||||
.await)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue