aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_drops.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/api_drops.go')
-rw-r--r--internal/admin/api_drops.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/admin/api_drops.go b/internal/admin/api_drops.go
index 7645d39..0d14841 100644
--- a/internal/admin/api_drops.go
+++ b/internal/admin/api_drops.go
@@ -13,15 +13,15 @@ import (
func (s *AdminServer) handleDrops(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
- ids, err := listYAMLFiles(s.dataDir, "drops")
+ tree, err := listYAMLTree(s.dataDir, "drops")
if err != nil {
writeJSON(w, map[string]any{"error": err.Error()})
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.createDrop(w, r)