diff options
| author | historia <[not public]> | 2026-06-30 19:27:37 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-30 19:27:37 -0400 |
| commit | fee376102192dc6f24297a7b11324636ace3a07d (patch) | |
| tree | 6c777cc71208b429eebdbdc5864b353d4af34a09 /internal/admin/api_mobs.go | |
| parent | 98bdef072c843fdd8ccdf85a9b54ab9d32d34187 (diff) | |
| download | thehouseoficarus-fee376102192dc6f24297a7b11324636ace3a07d.tar.gz | |
feat: admin gui object CRUD is much nicer
Diffstat (limited to 'internal/admin/api_mobs.go')
| -rw-r--r-- | internal/admin/api_mobs.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/admin/api_mobs.go b/internal/admin/api_mobs.go index 5fdfbc8..da088d3 100644 --- a/internal/admin/api_mobs.go +++ b/internal/admin/api_mobs.go @@ -11,15 +11,15 @@ import ( func (s *AdminServer) handleMobs(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: - ids, err := listYAMLFiles(s.dataDir, "mobs") + tree, err := listYAMLTree(s.dataDir, "mobs") 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.createMob(w, r) |
