From fee376102192dc6f24297a7b11324636ace3a07d Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 30 Jun 2026 19:27:37 -0400 Subject: feat: admin gui object CRUD is much nicer --- internal/admin/api_modules.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/admin/api_modules.go') diff --git a/internal/admin/api_modules.go b/internal/admin/api_modules.go index e676cd7..9fedccd 100644 --- a/internal/admin/api_modules.go +++ b/internal/admin/api_modules.go @@ -10,15 +10,15 @@ import ( func (s *AdminServer) handleModules(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: - ids, err := listYAMLFiles(s.dataDir, "modules") + tree, err := listYAMLTree(s.dataDir, "modules") 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 { -- cgit v1.2.3