aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_objects.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/api_objects.go')
-rw-r--r--internal/admin/api_objects.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/admin/api_objects.go b/internal/admin/api_objects.go
index e4a2c60..01a0803 100644
--- a/internal/admin/api_objects.go
+++ b/internal/admin/api_objects.go
@@ -11,15 +11,15 @@ import (
func (s *AdminServer) handleObjects(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
- ids, err := listYAMLFiles(s.dataDir, "objects")
+ tree, err := listYAMLTree(s.dataDir, "objects")
if err != nil {
http.Error(w, `{"error":"failed to list objects"}`, http.StatusInternalServerError)
return
}
- if ids == nil {
- ids = []string{}
+ if tree == nil {
+ tree = &YAMLTree{Root: []string{}, Dirs: map[string][]string{}}
}
- writeJSON(w, ids)
+ writeJSON(w, tree)
case http.MethodPost:
s.createObject(w, r)
default: