From 4b701ced5f00e819827e8a1bf66cb9fc633da8d4 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Tue, 19 May 2020 23:30:50 +0300 Subject: [PATCH] Remove ability to deactivate account from a status view page --- src/store/modules/users.js | 12 ++++++------ src/views/users/components/ModerationDropdown.vue | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 13d1e378..e86bcd49 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -77,14 +77,14 @@ const users = { } }, actions: { - async ActivateUsers({ dispatch, getters }, { users, _userId, _statusId }) { + async ActivateUsers({ dispatch, getters }, { users, _userId }) { const updatedUsers = users.map(user => { return { ...user, deactivated: false } }) const nicknames = users.map(user => user.nickname) const callApiFn = async() => await activateUsers(nicknames, getters.authHost, getters.token) - dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId, statusId: _statusId }) + dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId }) }, async ApplyChanges({ commit, dispatch, state }, { updatedUsers, callApiFn, userId, statusId }) { commit('SWAP_USERS', updatedUsers) @@ -135,14 +135,14 @@ const users = { } dispatch('SuccessMessage') }, - async DeactivateUsers({ dispatch, getters }, { users, _userId, _statusId }) { + async DeactivateUsers({ dispatch, getters }, { users, _userId }) { const updatedUsers = users.map(user => { return { ...user, deactivated: true } }) const nicknames = users.map(user => user.nickname) const callApiFn = async() => await deactivateUsers(nicknames, getters.authHost, getters.token) - dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId, statusId: _statusId }) + dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId }) }, async ConfirmUsersEmail({ dispatch, getters }, { users, _userId, _statusId }) { const updatedUsers = users.map(user => { @@ -171,7 +171,7 @@ const users = { dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId, statusId: _statusId }) }, - async DeleteUsers({ commit, dispatch, getters, state }, { users, _userId, _statusId }) { + async DeleteUsers({ commit, dispatch, getters, state }, { users, _userId }) { const usersNicknames = users.map(user => user.nickname) try { await deleteUsers(usersNicknames, getters.authHost, getters.token) @@ -182,7 +182,7 @@ const users = { const updatedUsers = state.fetchedUsers.filter(user => !deletedUsersIds.includes(user.id)) commit('SET_USERS', updatedUsers) - dispatch('FetchUserProfile', { userId: _userId, statusId: _statusId, godmode: false }) + dispatch('FetchUserProfile', { userId: _userId, godmode: false }) dispatch('SuccessMessage') }, async FetchUsers({ commit, dispatch, getters, state }, { page }) { diff --git a/src/views/users/components/ModerationDropdown.vue b/src/views/users/components/ModerationDropdown.vue index 33db5cf8..dc1b74f5 100644 --- a/src/views/users/components/ModerationDropdown.vue +++ b/src/views/users/components/ModerationDropdown.vue @@ -27,13 +27,13 @@ {{ user.roles.moderator ? $t('users.revokeModerator') : $t('users.grantModerator') }} {{ user.deactivated ? $t('users.activateAccount') : $t('users.deactivateAccount') }} {{ $t('users.deleteAccount') }} @@ -135,7 +135,7 @@ export default { this.$store.dispatch('ResendConfirmationEmail', [user]) }, handleDeletion(user) { - this.$store.dispatch('DeleteUsers', { users: [user], _userId: user.id, _statusId: this.statusId }) + this.$store.dispatch('DeleteUsers', { users: [user], _userId: user.id }) }, handleEmailConfirmation(user) { this.$store.dispatch('ConfirmUsersEmail', { users: [user], _userId: user.id, _statusId: this.statusId }) @@ -156,8 +156,8 @@ export default { }, toggleActivation(user) { user.deactivated - ? this.$store.dispatch('ActivateUsers', { users: [user], _userId: user.id, _statusId: this.statusId }) - : this.$store.dispatch('DeactivateUsers', { users: [user], _userId: user.id, _statusId: this.statusId }) + ? this.$store.dispatch('ActivateUsers', { users: [user], _userId: user.id }) + : this.$store.dispatch('DeactivateUsers', { users: [user], _userId: user.id }) }, toggleTag(user, tag) { user.tags.includes(tag)