Updating a team/user right now uses the new update method
This commit is contained in:
parent
65cd505059
commit
f1d48fd47c
3 changed files with 27 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
1
todo.md
1
todo.md
|
@ -52,3 +52,4 @@
|
|||
* [x] freigeben
|
||||
* [x] entfernen
|
||||
* [x] Einstellmglkt für Rechte
|
||||
* [x] Den Sharing-Updateshit mit der neuen methode machen (post)
|
Loading…
Reference in a new issue