Updating a team/user right now uses the new update method

This commit is contained in:
kolaente 2018-09-19 20:41:53 +02:00
parent 65cd505059
commit f1d48fd47c
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
3 changed files with 27 additions and 8 deletions

View file

@ -160,10 +160,19 @@
})
},
toggleTeamType(teamid, current) {
this.teamToDelete = teamid
this.newTeam.team_id = teamid
this.deleteTeam()
this.addTeam(!current)
let right = 0
if (!current) {
right = 2
}
HTTP.post(this.typeString + `s/` + this.id + `/teams/` + teamid, {right: right}, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
.then(() => {
this.loadTeams()
this.handleSuccess({message: 'The team right was successfully updated.'})
})
.catch(e => {
this.handleError(e)
})
},
handleError(e) {
this.loading = false

View file

@ -162,10 +162,19 @@
})
},
toggleUserType(userid, current) {
this.userToDelete = userid
this.newUser.user_id = userid
this.deleteUser()
this.addUser(!current)
let right = 0
if (!current) {
right = 2
}
HTTP.post(this.typeString + `s/` + this.id + `/users/` + userid, {right: right}, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
.then(() => {
this.loadUsers()
this.handleSuccess({message: 'The user right was successfully updated.'})
})
.catch(e => {
this.handleError(e)
})
},
handleError(e) {
this.loading = false

View file

@ -52,3 +52,4 @@
* [x] freigeben
* [x] entfernen
* [x] Einstellmglkt für Rechte
* [x] Den Sharing-Updateshit mit der neuen methode machen (post)