Skip to content
Snippets Groups Projects
Commit dafcd4d5 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Update action in dropdown, add confirmation when deleting a user

parent 1211ad3a
No related branches found
No related tags found
No related merge requests found
......@@ -72,11 +72,26 @@ export default {
}
},
methods: {
handleDeactivation({ nickname }) {
this.$store.dispatch('ToggleUserActivation', nickname)
handleDeactivation(user) {
user.deactivated
? this.$store.dispatch('ActivateUsers', { users: [user], _userId: user.id })
: this.$store.dispatch('DeactivateUsers', { users: [user], _userId: user.id })
},
handleDeletion(user) {
this.$store.dispatch('DeleteUser', user)
this.$confirm(
this.$t('users.deleteUserConfirmation'),
{
confirmButtonText: 'Delete',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
this.$store.dispatch('DeleteUsers', { users: [user], _userId: user.id })
}).catch(() => {
this.$message({
type: 'info',
message: 'Delete canceled'
})
})
},
showDeactivatedButton(id) {
return this.$store.state.user.id !== id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment