Description of changes:Problem: When a Name Request (NR) is approved, an unnecessary second patch request is sent, leading to a 401 error. This happens because the currentNameChoice is incorrectly set to undefined during the approval process.
Solution: Removed the code that sets the currentNameChoice to undefined from the parseNr method in the Examine Store.
Detailed Explanation
Upon NR approval via makeDecision(APPROVED), the pushDecision(APPROVED) and subsequently updateNRState(APPROVED) are triggered. Code Reference
This sequence leads to fetchAndLoadNr(nrNum) and then to parseNr(), where currentNameChoice was being set to undefined. Code Reference
With currentNameChoice undefined, the system incorrectly attempts to process a Next Name Choice, resulting in an unauthorized patch request. Code Reference
There seems to be no reason why the currentNameChoice gets set to undefined in parseNr. The application still has full functionality without that code.
Update E2E Tests for the fixed functionality.
Instead of waiting for the approval request to finish, the tests for approvals now ensure the response has a status code of 200.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).
Issue #: https://app.zenhub.com/workspaces/names-team-board-new-655554cbddd49510027dad2e/issues/gh/bcgov/entity/22784
Description of changes: Problem: When a Name Request (NR) is approved, an unnecessary second patch request is sent, leading to a 401 error. This happens because the
currentNameChoice
is incorrectly set to undefined during the approval process.Solution: Removed the code that sets the
currentNameChoice
to undefined from theparseNr
method in the Examine Store.Detailed Explanation
makeDecision(APPROVED)
, thepushDecision(APPROVED)
and subsequentlyupdateNRState(APPROVED)
are triggered. Code ReferencefetchAndLoadNr(nrNum)
and then toparseNr()
, where currentNameChoice was being set to undefined. Code ReferencecurrentNameChoice
undefined, the system incorrectly attempts to process a Next Name Choice, resulting in an unauthorized patch request. Code ReferencecurrentNameChoice
gets set to undefined inparseNr
. The application still has full functionality without that code.Update E2E Tests for the fixed functionality.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).