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_search.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/admin/api_search.go') diff --git a/internal/admin/api_search.go b/internal/admin/api_search.go index 3367a52..32ef292 100644 --- a/internal/admin/api_search.go +++ b/internal/admin/api_search.go @@ -29,6 +29,7 @@ func (s *AdminServer) handleSearch(w http.ResponseWriter, r *http.Request) { Mobs []searchResult `json:"mobs"` Objects []searchResult `json:"objects"` Hazards []searchResult `json:"hazards"` + Drops []searchResult `json:"drops"` } var resp searchResponse @@ -90,5 +91,12 @@ func (s *AdminServer) handleSearch(w http.ResponseWriter, r *http.Request) { } } + dropIDs, _ := listYAMLFiles(s.dataDir, "drops") + for _, id := range dropIDs { + if strings.Contains(strings.ToLower(id), q) { + resp.Drops = append(resp.Drops, searchResult{ID: id, Name: id}) + } + } + writeJSON(w, resp) } -- cgit v1.2.3