diff options
| author | historia <[not public]> | 2026-07-07 17:04:00 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-07 17:04:00 -0400 |
| commit | bae42946d24bd533cdbc1b271ce14acd752689d0 (patch) | |
| tree | fee984aead607deb7ba14e8736ff2cda942b9642 /internal/admin/api_room_insert_remove.go | |
| parent | 726997d799edc388cd448e978d5bb0755aaa551c (diff) | |
| download | thehouseoficarus-bae42946d24bd533cdbc1b271ce14acd752689d0.tar.gz | |
feat: standardize new room names to Room #<id>
Diffstat (limited to 'internal/admin/api_room_insert_remove.go')
| -rw-r--r-- | internal/admin/api_room_insert_remove.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/admin/api_room_insert_remove.go b/internal/admin/api_room_insert_remove.go index c5ed54a..8549d76 100644 --- a/internal/admin/api_room_insert_remove.go +++ b/internal/admin/api_room_insert_remove.go @@ -66,11 +66,6 @@ func (s *AdminServer) handleRoomInsert(w http.ResponseWriter, r *http.Request) { return } - name := strings.TrimSpace(body.Name) - if name == "" { - name = "New Room" - } - aPath, aPathOK := s.world.GetRoomPath(aID) if !aPathOK { writeJSONError(w, fmt.Sprintf("could not find the file for room #%d", aID), http.StatusInternalServerError) @@ -83,6 +78,11 @@ func (s *AdminServer) handleRoomInsert(w http.ResponseWriter, r *http.Request) { return } + name := strings.TrimSpace(body.Name) + if name == "" { + name = fmt.Sprintf("Room #%d", newID) + } + // Grid-conflict check on a hypothetical post-insert world. conflicts := world.InsertGridConflicts(aID, dir, bID, newID, func(id int) (*world.Room, bool) { r, err := s.world.LoadRoom(id) |
