From 69d83a3efbc4a0b05903ce1cff61445326e7973d Mon Sep 17 00:00:00 2001 From: squiddy Date: Sun, 26 May 2024 23:48:58 +0800 Subject: [PATCH] allow no initial users --- frontend/src/components/viewer/RoleViewer.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/viewer/RoleViewer.vue b/frontend/src/components/viewer/RoleViewer.vue index a565b09..64d8ec4 100644 --- a/frontend/src/components/viewer/RoleViewer.vue +++ b/frontend/src/components/viewer/RoleViewer.vue @@ -159,10 +159,12 @@ export default class RoleViewer extends Vue { desc: this.editedRole.desc, defaultPerm: this.editedRole.defaultPerm, permissions: this.editedRole.permissions - }).then(() => post(`/api/roles/${this.editedRole.rid}/users`, { - action: this.usersPopup.action, - emails: this.emailsWithRoles - })).then(() => EventBus.$emit('needRoleUpdate', () => { + }).then(() => { + if (this.emailsWithRoles) post(`/api/roles/${this.editedRole.rid}/users`, { + action: this.usersPopup.action, + emails: this.emailsWithRoles + }) + }).then(() => EventBus.$emit('needRoleUpdate', () => { this.$router.push({name: 'Role', params: {rid: this.editedRole.rid}}); this.saving = false; })).catch(err => {