Skip to content

Resolves issue #1771, Fixes the review object history to correctly reflect modified data when an approver modifies the request during approval.#1812

Merged
david-rocca merged 3 commits into
devfrom
dr_1771
May 21, 2026
Merged

Resolves issue #1771, Fixes the review object history to correctly reflect modified data when an approver modifies the request during approval.#1812
david-rocca merged 3 commits into
devfrom
dr_1771

Conversation

@david-rocca
Copy link
Copy Markdown
Collaborator

Closes Issue #1771

Summary

This PR fixes a bug where an approver modifying a review object during approval would successfully update the organization with the new data, but the review object history would erroneously retain the original requested data. The fix ensures that any modifications made during approval are properly persisted to the new_review_data field of the review object.

Important Changes

src/controller/review-object.controller/review-object.controller.js

  • Passed the body payload down to the approveReviewOrgObject repository function to capture the modified data.

src/repositories/reviewObjectRepository.js

  • Updated approveReviewOrgObject to accept an optional modifiedBody parameter.
  • Assigned modifiedBody to reviewObject.new_review_data prior to saving the approved status.

test/integration-tests/review-object/reviewObjectTest.js

  • Added an integration test to explicitly verify that a review object approved with modifications updates both the organization and accurately reflects those modifications in new_review_data.

Testing

Steps to manually test updated functionality:

  • 1. Run integration tests (npm run test:integration) to ensure no regressions.
  • 2. Have a non-secretariat user create a pending review object by updating an organization.
  • 3. Have an approver approve the review object and include modifications in the request payload.
  • 4. Retrieve the approved review object by its UUID and verify that new_review_data displays the modified data, not the original pending data.

Notes

  • This change strictly targets the data mismatch in review history. The broader approval flow logic remains untouched.
  • Full integration test coverage has been provided and validated for this use case.

@david-rocca david-rocca merged commit 588a76a into dev May 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants