update
This commit is contained in:
parent
d70dabc271
commit
9e9c48e5dd
4 changed files with 39 additions and 3 deletions
|
@ -61,9 +61,21 @@ pub async fn supply_log_route(
|
|||
Ok(json!(transactions))
|
||||
}
|
||||
|
||||
/// Returns current active Transactions for Item
|
||||
#[get("/item/<item_id>/inventory")]
|
||||
pub async fn inventory_route(item_id: &str, itemdb: &State<ItemDB>) -> FallibleApiResponse {
|
||||
let variant = itemdb
|
||||
.get_item(item_id)
|
||||
.ok_or_else(item_does_not_exist_error)?;
|
||||
|
||||
let transactions = variant.inventory().await;
|
||||
|
||||
Ok(json!(mongod::vec_to_api(&transactions).await))
|
||||
}
|
||||
|
||||
/// Returns current active Transactions for Item Variant
|
||||
#[get("/item/<item_id>/<variant_id>/inventory")]
|
||||
pub async fn inventory_route(
|
||||
pub async fn inventory_route_variant(
|
||||
item_id: &str,
|
||||
variant_id: &str,
|
||||
itemdb: &State<ItemDB>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue