Use error message from backend when updating member role

What does this MR do and why?

Related to #496741 (closed)

Since !154196 (merged) we no longer display the error message from the API response when updating a member's role. This can be confusing to users because they just get a generic message. This MR fixes this bug.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-10-03_at_12.48.22_PM Screenshot_2024-10-03_at_12.45.27_PM

How to set up and validate locally

  1. Follow instructions in https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance to create a group with Premium or higher license
  2. Go to that group -> Members
  3. Add some members
  4. Go to that group -> Settings -> General -> Permissions and group features.
  5. Add an email to Restrict membership by email domain field
  6. Go to that group -> Members
  7. Click on a members role to open the drawer
  8. Try to change the role
Edited by Peter Hegman

Merge request reports

Loading