Mentors that are also coordinators have incorrect initial matcher preferences #424
Labels
bug
Something isn't working
good first issue
Good for newcomers
sev3
High severity - Production system impaired
The matcher currently submits a
GET
request to fetch the matcher preferences for the current mentor to display in the mentor preference form:csm_web/csm_web/frontend/src/components/enrollment_automation/MentorSectionPreferences.tsx
Lines 73 to 78 in aed030a
However, if the user is also a coordinator, this result is actually the list of all preferences for all mentors, and these values end up overwriting each other, meaning the final preferences are (1) not the user's actual preferences, and (2) unpredictable, since it depends on the order of the response.
Further, if the user never actually submitted any preferences yet, the form also still be populated with other people's preferences.
A solution to this is to simply check for the mentor ID in the preference objects, and only save the preference if it matches the mentor's ID.
The text was updated successfully, but these errors were encountered: