diff options
| author | historia <[not public]> | 2026-07-05 22:35:21 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-05 22:35:21 -0400 |
| commit | 94823b52168b44894fb5e9c960358ed02ebb122b (patch) | |
| tree | 3060799b89bb7edfa708c72bdd981107d40f4d09 /internal/admin/api_rooms.go | |
| parent | 843fa6db681e494bf46e191655323a40577542b5 (diff) | |
| download | thehouseoficarus-94823b52168b44894fb5e9c960358ed02ebb122b.tar.gz | |
feat: courses gui overhaul, add course tab to map, add hidden exits to give courses structure
Diffstat (limited to 'internal/admin/api_rooms.go')
| -rw-r--r-- | internal/admin/api_rooms.go | 14 |
1 files changed, 14 insertions, 0 deletions
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) |
