add notes
This commit is contained in:
parent
b468aab088
commit
30b6f6a7b3
5 changed files with 15 additions and 3 deletions
|
@ -42,7 +42,11 @@ pub fn get_items_route(itemdb: &State<ItemDB>, t: Token, c: &State<Config>) -> F
|
|||
}
|
||||
|
||||
#[get("/items/stat")]
|
||||
pub async fn item_stat_route(itemdb: &State<ItemDB>, t: Token, c: &State<Config>) -> FallibleApiResponse {
|
||||
pub async fn item_stat_route(
|
||||
itemdb: &State<ItemDB>,
|
||||
t: Token,
|
||||
c: &State<Config>,
|
||||
) -> FallibleApiResponse {
|
||||
check_auth!(t, c);
|
||||
|
||||
let items = itemdb.items();
|
||||
|
@ -60,7 +64,6 @@ pub async fn item_stat_route(itemdb: &State<ItemDB>, t: Token, c: &State<Config>
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Ok(json!({
|
||||
"item_count": item_count,
|
||||
"total_transactions": transaction_count,
|
||||
|
|
|
@ -21,6 +21,7 @@ pub struct SupplyForm {
|
|||
price: String,
|
||||
origin: Option<String>,
|
||||
location: Option<String>,
|
||||
note: Option<String>,
|
||||
}
|
||||
|
||||
/// Route for supply action. Creates a new Transaction for the specified Item Variant.
|
||||
|
@ -47,6 +48,7 @@ pub async fn supply_route(
|
|||
.map_err(|()| api_error("Price malformed"))?,
|
||||
form.origin.as_deref(),
|
||||
form.location.as_deref(),
|
||||
form.note.as_deref(),
|
||||
)
|
||||
.await;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue