Use role selection response for setting role

Previously we were fetching the role assignments again. Not necessary,
as the request for setting a role already returns the resulting
assignment object as a response.
This commit is contained in:
Benedikt Kulmann
2020-08-21 16:15:06 +02:00
parent eb05ba253a
commit 0e4e211123
+4 -1
View File
@@ -95,7 +95,10 @@ export default {
})
if (response.status === 201) {
this.getUsersCurrentRole()
const roleId = response.data.assignment.roleId
this.currentRole = this.roles.find(role => {
return role.id === roleId
})
} else {
this.showMessage({
title: this.$gettext('Failed to change role.'),