aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_objects.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-30 19:27:37 -0400
committerhistoria <[not public]>2026-06-30 19:27:37 -0400
commitfee376102192dc6f24297a7b11324636ace3a07d (patch)
tree6c777cc71208b429eebdbdc5864b353d4af34a09 /internal/admin/api_objects.go
parent98bdef072c843fdd8ccdf85a9b54ab9d32d34187 (diff)
downloadthehouseoficarus-fee376102192dc6f24297a7b11324636ace3a07d.tar.gz
feat: admin gui object CRUD is much nicer
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: