fix: remove unnecessary grouped lookup in verify work experience#4317
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in the public members work-experience APIs where actions on hidden/overlapping work-experience rows could fail with Work experience not found due to ID lookup happening on grouped (display) data rather than the raw rows.
Changes:
- Update
verifyMemberWorkExperienceto resolve the target work-experience row by ID from ungrouped org-enriched rows, while still returning grouped (display) data when available. - Update
updateMemberWorkExperienceto fall back to the ungrouped row when building the response for hidden IDs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts | Switch ID lookup to ungrouped org-enriched rows; keep grouped response for visible rows with fallback for hidden IDs. |
| backend/src/api/public/v1/members/work-experiences/updateMemberWorkExperience.ts | Response-building now falls back to the ungrouped row if the grouped (display) set cannot resolve the requested ID. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
…data Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
…ation Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
…tion Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up fix to CM-1266. Cleans up
verifyMemberWorkExperienceafter the domains change accidentally added a pre-transaction grouped lookup that could block the handler before the transaction runs.Clients call this endpoint with the display work experience ID returned by the list API, not hidden grouped row IDs.
Changes
NotFoundErrorcheck (the CM-1266 regression)fetchMemberOrganizationsonlywithDomains: trueon the post-transaction response fetchverified: false), stash org data before soft-delete and use grouped before-data for the response fallback (org name/logo/domains + merged dates/source)verified: true) since the row still exists post-transactionTest plan
test-lfxOne-cdp-auth.sh) — verify, reject, grouping, domains