fix: segment change request warning shows on all segments #6255
+4
−4
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.
docs/if required so people know about the feature!Fixes #6219 When a project has segment change requests enabled and a change request is created for one segment, all segments (including the "New segment" modal) incorrectly show the warning that there are open change requests. The warning should only appear on the segment that actually has an open change request.
Changes
The issue was caused by a query parameter mismatch between the frontend and the backend API:
Frontend was sending: version_of: segmentId
Backend expected: segment_id
In the ExistingProjectChangeRequestAlert component, the API query was using an incorrect parameter name (version_of) that the backend API doesn't recognize. As a result, the filter wasn't being applied, and the API was returning all open change requests for the project instead of just those for the specific segment.
Changes Made
How did you test this code?
Manual Testing Steps:
Impact