Fix(full-stack): Align regenerate_section endpoint and usage
Created by: Edouard-Legoupil
This commit resolves a 400 Bad Request error that occurred when regenerating a proposal section. The error was caused by a mismatch between the frontend API call and the backend endpoint.
The frontend was sending the proposal_id in the URL, while the backend was expecting a session_id. Additionally, the frontend tests were failing due to a combination of incorrect mock server configuration, missing dependencies, and test timeouts.
This commit addresses the issue by:
-
Updating the
regenerate_sectionendpoint inbackend/api/proposals.pyto accept theproposal_idin the URL. -
Modifying the
handleRegenerateButtonClickfunction infrontend/src/screens/Chat/Chat.jsxto send theproposal_idin the URL. -
Correcting the frontend test setup in
frontend/setupTests.jsandfrontend/vitest.config.jsto ensure that the mock server is correctly initialized and that the tests have a sufficient timeout. -
Updating the frontend tests in
frontend/src/screens/Chat/Chat.test.jsxto reflect the changes to the API and to resolve test failures. -
Does my code meet the quality standards for releasing packages?
-
Does the reviewer have all the information to validate the features/issues without too much research?
-
Does the customer who will validate the associated tickets have the information to do so without wasting time?
Issues to validate to close :
-
issue #
Processed issues to keep open or in progress:
-
issue #
Checklist:
-
Does the package check go local? -
Does the CI pass? -
Are the added / fixed features documented, tested? -
Are the added features / solved problems briefly presented in the PR message? -
Are the changes related to tickets / issues that I have listed in the commits and in the PR itself? -
Are the tickets in "review" mode in the Project Tracking Board? -
Does each ticket, if it is to be closed after acceptance of the PR, contain a comment that tells how to validate it?