From b65c6925edc04a5b025a71ceac670fb4ab967afb Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Fri, 31 Jul 2020 14:54:12 +0200 Subject: [PATCH] Stop removing previous assignments The assignments are now removed through the server. No need to do this via JS anymore --- ui/components/accounts/AccountsListRow.vue | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/ui/components/accounts/AccountsListRow.vue b/ui/components/accounts/AccountsListRow.vue index d41fcdc2e7..3319a974ed 100644 --- a/ui/components/accounts/AccountsListRow.vue +++ b/ui/components/accounts/AccountsListRow.vue @@ -57,8 +57,7 @@ export default { data () { return { - currentRole: null, - currentAssignment: null + currentRole: null } }, @@ -81,25 +80,6 @@ export default { methods: { changeRole (roleId) { - this.removeAssignment().then(() => this.addAssignment(roleId)) - }, - - removeAssignment () { - if (this.currentAssignment === null) { - return Promise.resolve() - } - - return fetch(`${this.configuration.server}/api/v0/settings/assignments-remove`, { - method: 'POST', - mode: 'cors', - headers: this.headers, - body: JSON.stringify({ - id: this.currentAssignment.id - }) - }) - }, - - addAssignment (roleId) { fetch(`${this.configuration.server}/api/v0/settings/assignments-add`, { method: 'POST', mode: 'cors', @@ -129,7 +109,6 @@ export default { return } - this.currentAssignment = assignedRole.assignments[0] this.currentRole = this.roles.find(role => { return role.id === assignedRole.assignments[0].roleId })