package admin import ( "net/http" ) func (s *AdminServer) handleStations(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { http.Error(w, "method not allowed", http.StatusMethodNotAllowed) return } items, err := s.itemStore.LoadAll() if err != nil { http.Error(w, "failed to load items", http.StatusInternalServerError) return } seen := map[string]bool{} var stations []string for _, def := range items { if def.Craft != nil { for _, c := range def.Craft { for _, s := range c.Station { if s != "" { if !seen[s] { seen[s] = true stations = append(stations, s) } } } } } } writeJSON(w, stations) }