AOSSIE-Org / AOSSIE-Org/EduAid

[BUG]: API endpoint mismatch between /get_shortq_answer and /get_answer breaks tests

Đang mở
#519 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
171
Fork
425
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Bug Description

Description:
There is a mismatch between backend routes and test usage.

In server.py:
POST /get_shortq_answer

In test_server.py:
POST /get_answer

This results in 404 errors and JSONDecodeError when running backend tests or calling the API.

Steps to Reproduce:
1. Run the Flask backend
2. Run test_server.py
3. Observe failure when calling /get_answer

Expected Behavior:
Backend endpoint names should be consistent with tests and frontend usage.

Proposed Fix:
- Rename /get_shortq_answer to /get_answer OR
- Update tests (and frontend) to use /get_shortq_answer consistently

Additional Notes:
This inconsistency may also contribute to frontend crashes and unclear API contracts.

### Steps to Reproduce

_No response_

### Logs and Screenshots

_No response_

### Environment Details

Environment Details:
- OS: Windows 11
- Python version: 3.10.x (or run `python --version` and paste exact)
- Flask version: 2.x
- Node.js: N/A (backend only)
- Browser (if applicable): Chrome (latest)
- Repo branch: main
- Setup: Local development (Flask server running on localhost:5000)

Additional Context:
- Issue observed while running `test_Server.py`
- Backend route defined as `/get_shortq_answer`, but tests call `/get_answer`
- Results in 404 response and JSONDecodeError during test execution

### Impact

Critical - Application is unusable

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

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.