diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-29 00:09:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-29 00:09:04 +0300 |
commit | c6c346e8c7f0865f0016a458511e9fabfc8b9c1a (patch) | |
tree | 5b3a734e945e18c88817935c359c191140a11010 /app/assets/javascripts/members | |
parent | e1b9b92a49eea88ea7c3b101aec0315e64e94678 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/members')
-rw-r--r-- | app/assets/javascripts/members/store/actions.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/members/store/mutations.js | 18 |
2 files changed, 12 insertions, 10 deletions
diff --git a/app/assets/javascripts/members/store/actions.js b/app/assets/javascripts/members/store/actions.js index 4c31b3c9744..3f9c0a3faba 100644 --- a/app/assets/javascripts/members/store/actions.js +++ b/app/assets/javascripts/members/store/actions.js @@ -11,7 +11,7 @@ export const updateMemberRole = async ({ state, commit }, { memberId, accessLeve commit(types.RECEIVE_MEMBER_ROLE_SUCCESS, { memberId, accessLevel }); } catch (error) { - commit(types.RECEIVE_MEMBER_ROLE_ERROR); + commit(types.RECEIVE_MEMBER_ROLE_ERROR, { error }); throw error; } @@ -37,7 +37,7 @@ export const updateMemberExpiration = async ({ state, commit }, { memberId, expi expiresAt: expiresAt ? formatDate(expiresAt, 'isoUtcDateTime') : null, }); } catch (error) { - commit(types.RECEIVE_MEMBER_EXPIRATION_ERROR); + commit(types.RECEIVE_MEMBER_EXPIRATION_ERROR, { error }); throw error; } diff --git a/app/assets/javascripts/members/store/mutations.js b/app/assets/javascripts/members/store/mutations.js index 2415e744290..f4aac1571d6 100644 --- a/app/assets/javascripts/members/store/mutations.js +++ b/app/assets/javascripts/members/store/mutations.js @@ -13,10 +13,10 @@ export default { 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.", - ); + [types.RECEIVE_MEMBER_ROLE_ERROR](state, { error }) { + state.errorMessage = + error.response?.data?.message || + s__("Members|An error occurred while updating the member's role, please try again."); state.showError = true; }, [types.RECEIVE_MEMBER_EXPIRATION_SUCCESS](state, { memberId, expiresAt }) { @@ -28,10 +28,12 @@ export default { Vue.set(member, 'expiresAt', expiresAt); }, - [types.RECEIVE_MEMBER_EXPIRATION_ERROR](state) { - state.errorMessage = s__( - "Members|An error occurred while updating the member's expiration date, please try again.", - ); + [types.RECEIVE_MEMBER_EXPIRATION_ERROR](state, { error }) { + state.errorMessage = + error.response?.data?.message || + s__( + "Members|An error occurred while updating the member's expiration date, please try again.", + ); state.showError = true; }, [types.HIDE_ERROR](state) { |