aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_techs.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/api_techs.go')
-rw-r--r--internal/admin/api_techs.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/admin/api_techs.go b/internal/admin/api_techs.go
index 9b29647..bdb8295 100644
--- a/internal/admin/api_techs.go
+++ b/internal/admin/api_techs.go
@@ -10,15 +10,15 @@ import (
func (s *AdminServer) handleTechs(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
- ids, err := listYAMLFiles(s.dataDir, "techs")
+ tree, err := listYAMLTree(s.dataDir, "techs")
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:
var m map[string]any
if err := readJSON(r, &m); err != nil {