add min + expiry
This commit is contained in:
parent
0e174dc06e
commit
e1618b40ef
7 changed files with 88 additions and 17 deletions
|
@ -5,6 +5,7 @@ mod supply;
|
|||
pub use demand::*;
|
||||
pub use error::*;
|
||||
use mongod::Model;
|
||||
use mongod::ToAPI;
|
||||
pub use supply::*;
|
||||
|
||||
use rocket::get;
|
||||
|
@ -53,7 +54,7 @@ pub async fn transaction_route(transaction: &str) -> FallibleApiResponse {
|
|||
let t = Transaction::get(transaction)
|
||||
.await
|
||||
.ok_or_else(|| api_error("No transaction with this UUID"))?;
|
||||
Ok(t.api_json())
|
||||
Ok(t.api().await)
|
||||
}
|
||||
|
||||
/// Returns unique values for a field
|
||||
|
|
|
@ -74,10 +74,7 @@ pub async fn inventory_route(
|
|||
|
||||
let transactions = variant.inventory().await;
|
||||
|
||||
Ok(json!(transactions
|
||||
.into_iter()
|
||||
.map(|x| x.api_json())
|
||||
.collect::<Vec<_>>()))
|
||||
Ok(json!(mongod::vec_to_api(&transactions).await))
|
||||
}
|
||||
|
||||
/// Returns statistics for the Item Variant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue