AOSSIE-Org / AOSSIE-Org/DebateAI

## 🐞[Bug] `POST /rooms` endpoint missing – Room creation fails with 404

Đang mở
#207 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
84
Fork
198
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
30

Mô tả

### Description
Creating a new debate room from the frontend fails consistently.
The frontend sends a `POST /rooms` request, but the backend responds with **404 Not Found**, indicating that the endpoint is not implemented or not registered.

As a result:
- Room creation fails
- WebSocket connections (`/ws`) repeatedly return `400`
- Users cannot start a debate session

---

### Steps to Reproduce
1. Run the backend server (Gin)
2. Run the frontend (`npm run dev`)
3. Log in successfully
4. Navigate to **Start Debate**
5. Click **Create Room**

---

### Expected Behavior
- Backend should handle `POST /rooms`
- A new room should be created and returned with a room ID
- Frontend should navigate to the debate room
- WebSocket connection should succeed

Image

---

### Actual Behavior
- Backend responds with `404 Not Found` for `POST /rooms`
- Frontend shows error: **“Error creating room”**
- WebSocket repeatedly retries and fails with `400`

---

### Backend Logs

[GIN] | 200 | GET "/rooms"
[GIN] | 404 | POST "/rooms"

This confirms:

- GET /rooms is implemented and working
- POST /rooms is missing or not registered

---

### Impact

- Core functionality (room creation) is blocked
- Any features dependent on rooms (WebSocket, debate flow, AI features) cannot work
- Prevents testing and further development

---

### Suggested Fix

- Implement and register a POST /rooms route in the backend
- Validate request payload
- Create and persist a room entity
- Return the created room (or room ID) in the response

---

### Environment

- Frontend: React + Vite
- Backend: Go (Gin)
- Authentication: JWT (working correctly)
- Environment: Local development (localhost)

---

I am willing to submit a PR.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.