fix: refresh course data when moving to review to get automated generated slug #888
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PROD-3460
Description
The learn/subdirectory slug for a course is generated when a course run is moved to legal review. When the action to move a course run to legal review is initiated, two API calls are made. One for Course update and then course run update. It is in 2nd API call where the course slug is updated. This updates the data on the backend but the frontend does not contain updated course information. Refreshing of the page is required to bring in fresh data. This PR adds a change to refreshData when a course run is moved to legal review, only if the new slug format flag is enabled.
There are no unit tests in place for functions like handleCourseRuns or editCourse. Setting their unit tests would require some effort, which is already being discussed internally. That's why I did not add a unit test.