fix
This commit is contained in:
parent
ad96e2938d
commit
c68f871f4d
3 changed files with 29 additions and 26 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use mongod::{vec_to_api, ToAPI};
|
||||
use mongod::{reference_of, vec_to_api, Model, ToAPI};
|
||||
use rocket::{get, State};
|
||||
use serde_json::json;
|
||||
|
||||
|
@ -109,6 +109,9 @@ pub async fn location_inventory(
|
|||
) -> FallibleApiResponse {
|
||||
check_auth!(t, c);
|
||||
|
||||
let location =
|
||||
reference_of!(Location, location).ok_or_else(|| api_error("No such location"))?;
|
||||
|
||||
if let Some("true" | "yes" | "1") = recursive {
|
||||
return Ok(json!(
|
||||
vec_to_api(&Transaction::in_location_recursive(location).await).await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue