diff options
Diffstat (limited to 'app/assets/javascripts/vuex_shared/modules/members/mutations.js')
-rw-r--r-- | app/assets/javascripts/vuex_shared/modules/members/mutations.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/assets/javascripts/vuex_shared/modules/members/mutations.js b/app/assets/javascripts/vuex_shared/modules/members/mutations.js new file mode 100644 index 00000000000..281c947e68f --- /dev/null +++ b/app/assets/javascripts/vuex_shared/modules/members/mutations.js @@ -0,0 +1,33 @@ +import Vue from 'vue'; +import { s__ } from '~/locale'; +import * as types from './mutation_types'; +import { findMember } from './utils'; + +export default { + [types.RECEIVE_MEMBER_ROLE_SUCCESS](state, { memberId, accessLevel }) { + const member = findMember(state, memberId); + + if (!member) { + return; + } + + Vue.set(member, 'accessLevel', accessLevel); + }, + [types.RECEIVE_MEMBER_ROLE_ERROR](state) { + state.errorMessage = s__( + "Members|An error occurred while updating the member's role, please try again.", + ); + state.showError = true; + }, + [types.HIDE_ERROR](state) { + state.showError = false; + state.errorMessage = ''; + }, + [types.SHOW_REMOVE_GROUP_LINK_MODAL](state, groupLink) { + state.removeGroupLinkModalVisible = true; + state.groupLinkToRemove = groupLink; + }, + [types.HIDE_REMOVE_GROUP_LINK_MODAL](state) { + state.removeGroupLinkModalVisible = false; + }, +}; |