+ v-on:submit="deleteUser()">
Remove a user from the team
Are you sure you want to remove this user from the team?
He will loose access to all lists and namespaces this team has access to.
@@ -134,6 +152,7 @@
user: auth.user,
userIsAdmin: false,
userToDelete: 0,
+ newUser: {id:0},
}
},
beforeMount() {
@@ -199,6 +218,7 @@
deleteUser() {
HTTP.delete(`teams/` + this.$route.params.id + `/members/` + this.userToDelete, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
.then(() => {
+ this.showUserDeleteModal = false;
this.handleSuccess({message: 'The user was successfully deleted from the team.'})
this.loadTeam()
})
@@ -206,13 +226,14 @@
this.handleError(e)
})
},
- addUser(userid, admin) {
+ addUser(admin) {
if(admin === null) {
admin = false
}
- HTTP.put(`teams/` + this.$route.params.id + `/members`, {admin: admin, user_id: userid}, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
+ HTTP.put(`teams/` + this.$route.params.id + `/members`, {admin: admin, user_id: this.newUser.id}, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
.then(() => {
- this.handleSuccess({message: 'The team was successfully added.'})
+ this.loadTeam()
+ this.handleSuccess({message: 'The team member was successfully added.'})
})
.catch(e => {
this.handleError(e)
@@ -220,8 +241,9 @@
},
toggleUserType(userid, current) {
this.userToDelete = userid
+ this.newUser.id = userid
this.deleteUser()
- this.addUser(userid, !current)
+ this.addUser(!current)
},
handleError(e) {
this.loading = false
@@ -243,7 +265,13 @@
.card{
margin-bottom: 1rem;
+ .add-member-form {
+ margin: 1rem;
+ }
+
.table{
+ border-top: 1px solid darken(#fff, 15%);
+
td{
vertical-align: middle;
}