update
This commit is contained in:
parent
e7fe303941
commit
6f9048e5b1
6 changed files with 92 additions and 56 deletions
|
@ -62,13 +62,13 @@ pub async fn locations_list(
|
|||
) -> FallibleApiResponse {
|
||||
check_auth!(t, c);
|
||||
|
||||
let mut lst = Vec::with_capacity(locations.len());
|
||||
let mut ret = HashMap::<String, serde_json::Value>::new();
|
||||
|
||||
for id in locations.deref().keys() {
|
||||
lst.push(id);
|
||||
for l in locations.iter() {
|
||||
ret.insert(l.0.clone(), l.1.api().await);
|
||||
}
|
||||
|
||||
Ok(json!(lst))
|
||||
Ok(json!(ret))
|
||||
}
|
||||
|
||||
#[get("/location_map")]
|
||||
|
@ -98,3 +98,16 @@ pub async fn locations_info(
|
|||
|
||||
Ok(serde_json::to_value(location_api).unwrap())
|
||||
}
|
||||
|
||||
#[get("/location/<location>/inventory")]
|
||||
pub async fn location_inventory(
|
||||
location: &str,
|
||||
t: Token,
|
||||
locations: &State<JSONStore<Location>>,
|
||||
c: &State<Config>,
|
||||
) -> FallibleApiResponse {
|
||||
check_auth!(t, c);
|
||||
|
||||
// todo : inventory
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue