mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Configurable Struct
This commit is contained in:
@@ -21,7 +21,7 @@ impl Server {
|
||||
}
|
||||
|
||||
pub async fn get_tree2(
|
||||
State(server): State<Server>,
|
||||
State(mut server): State<Server>,
|
||||
Path(path): Path<String>,
|
||||
Extension(_): Extension<CurrentUser>,
|
||||
) -> Json<Value> {
|
||||
@@ -33,4 +33,19 @@ impl Server {
|
||||
|
||||
Json(serde_json::to_value(result).unwrap())
|
||||
}
|
||||
|
||||
pub async fn post_tree2(
|
||||
State(mut server): State<Server>,
|
||||
Path(path): Path<String>,
|
||||
Extension(_): Extension<CurrentUser>,
|
||||
Json(tree_message): Json<TreeMessage>,
|
||||
) -> Json<Value> {
|
||||
debug!("POST /api/interface/{}", path);
|
||||
|
||||
let result = server
|
||||
.get(&path, tree_message)
|
||||
.map_err(|e| ModuleError::CryptError(e.to_string()));
|
||||
|
||||
Json(serde_json::to_value(result).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user