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_search.go | |
| parent | 98bdef072c843fdd8ccdf85a9b54ab9d32d34187 (diff) | |
| download | thehouseoficarus-fee376102192dc6f24297a7b11324636ace3a07d.tar.gz | |
feat: admin gui object CRUD is much nicer
Diffstat (limited to 'internal/admin/api_search.go')
| -rw-r--r-- | internal/admin/api_search.go | 8 |
1 files changed, 8 insertions, 0 deletions
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) } |
