src/api_schema/router.rs: implement list_subdirs() helper

This commit is contained in:
Dietmar Maurer
2019-04-16 12:07:02 +02:00
parent 062d4916ff
commit 13f1cc17ea
9 changed files with 36 additions and 81 deletions

View File

@ -387,19 +387,6 @@ pub fn router() -> Router {
);
let datastore_info = Router::new()
.get(ApiMethod::new(
|| Ok(json!([
{"subdir": "backups" },
{"subdir": "pxar" },
{"subdir": "gc" },
{"subdir": "groups" },
{"subdir": "snapshots" },
//{"subdir": "status" },
{"subdir": "prune" },
])),
ObjectSchema::new("Directory index.")
.required("store", store_schema.clone()))
)
.subdir(
"backups",
Router::new()
@ -470,7 +457,9 @@ pub fn router() -> Router {
.subdir(
"prune",
Router::new()
.post(api_method_prune()));
.post(api_method_prune())
)
.list_subdirs();