add min + expiry

This commit is contained in:
JMARyA 2024-08-30 14:13:56 +02:00
parent 0e174dc06e
commit e1618b40ef
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
7 changed files with 88 additions and 17 deletions

View file

@ -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

View file

@ -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