Configurable Struct

This commit is contained in:
Michael Mikovsky
2025-12-21 12:04:53 -07:00
parent c7d66c5560
commit 78fda07ab2
11 changed files with 160 additions and 98 deletions
+16 -1
View File
@@ -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())
}
}