From 94823b52168b44894fb5e9c960358ed02ebb122b Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 5 Jul 2026 22:35:21 -0400 Subject: feat: courses gui overhaul, add course tab to map, add hidden exits to give courses structure --- internal/admin/api_rooms.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/admin/api_rooms.go') diff --git a/internal/admin/api_rooms.go b/internal/admin/api_rooms.go index b7f7d0e..448503d 100644 --- a/internal/admin/api_rooms.go +++ b/internal/admin/api_rooms.go @@ -138,7 +138,9 @@ func (s *AdminServer) handleRooms(w http.ResponseWriter, r *http.Request) { func (s *AdminServer) handleRoomByID(w http.ResponseWriter, r *http.Request) { idStr := strings.TrimPrefix(r.URL.Path, "/api/rooms/") + sub := "" if idx := strings.IndexByte(idStr, '/'); idx >= 0 { + sub = idStr[idx+1:] idStr = idStr[:idx] } id, err := strconv.Atoi(idStr) @@ -147,6 +149,18 @@ func (s *AdminServer) handleRoomByID(w http.ResponseWriter, r *http.Request) { return } + switch sub { + case "course": + s.handleRoomCourse(w, r, id) + return + case "courses/attach": + s.handleRoomAttachCourse(w, r, id) + return + case "courses/detach": + s.handleRoomDetachCourse(w, r, id) + return + } + switch r.Method { case http.MethodGet: path, ok := s.world.GetRoomPath(id) -- cgit v1.2.3