Skip to content

Commit

Permalink
fix(orga): correct member role update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbeaumont79 authored and er-lim committed Dec 2, 2024
1 parent 2751e0b commit 5eeca1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion orga/app/components/team/members-list-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@placeholder="{{t 'pages.team-members.actions.select-role.label'}}"
@onChange={{this.setRoleSelection}}
@options={{this.organizationRoles}}
@value={{@membership.organizationRole}}
@value={{this.roleSelection}}
>
<:label>{{t "pages.team-members.actions.select-role.label"}}</:label>
</PixSelect>
Expand Down
6 changes: 4 additions & 2 deletions orga/app/components/team/members-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class MembersListItem extends Component {
@tracked isEditionMode = false;
@tracked isRemoveMembershipModalDisplayed = false;
@tracked isLeaveOrganizationModalDisplayed = false;
@tracked roleSelection = null;

adminOption = {
value: 'ADMIN',
Expand All @@ -37,6 +38,7 @@ export default class MembersListItem extends Component {
constructor() {
super(...arguments);
this.organizationRoles = [this.adminOption, this.memberOption];
this.roleSelection = this.args.membership.organizationRole;
}

get displayRole() {
Expand All @@ -53,7 +55,7 @@ export default class MembersListItem extends Component {

@action
setRoleSelection(value) {
this.args.membership.organizationRole = value;
this.roleSelection = value;
}

@action
Expand All @@ -64,7 +66,7 @@ export default class MembersListItem extends Component {
@action
async updateRoleOfMember(membership) {
this.isEditionMode = false;

membership.organizationRole = this.roleSelection;
membership.organization = this.currentUser.organization;

try {
Expand Down

0 comments on commit 5eeca1a

Please sign in to comment.