AOSSIE-Org / AOSSIE-Org/EduAid

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

Aperta
#519 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
JavaScript
Stelle
171
Fork
425
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.