Skip to content

Fix(full-stack): Align regenerate_section endpoint and usage

Edouard Legoupil requested to merge fix-regenerate-section-endpoint into main_dev

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, as well as a redundant proposal_id in the request body.

This commit addresses the issue by:

  • Updating the regenerate_section endpoint in backend/api/proposals.py to accept the proposal_id in the URL and removing the proposal_id from the RegenerateRequest model.

  • Modifying the handleRegenerateButtonClick function in frontend/src/screens/Chat/Chat.jsx to send the proposal_id in the URL and remove it from the request body.

  • Updating the backend test in backend/tests/test_regenerate_section.py to reflect the changes to the API.

  • Correcting the frontend test setup in frontend/setupTests.js and frontend/vitest.config.js to 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.jsx to 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?

Merge request reports

Loading