fix user role change modal

This commit is contained in:
mahula 2023-03-24 14:36:02 +01:00
parent 3d1eb2b939
commit c08b5387c5

View File

@ -27,7 +27,7 @@
:title="modalTitle" :title="modalTitle"
:cancel-title="$t('overlay.cancel')" :cancel-title="$t('overlay.cancel')"
:ok-title="modalOkTitle" :ok-title="modalOkTitle"
@ok="modalEvent" @ok="setUserRole(roleSelected, currentRole)"
> >
<p class="my-4">{{ modalQuestion }}</p> <p class="my-4">{{ modalQuestion }}</p>
</b-modal> </b-modal>
@ -60,17 +60,9 @@ export default {
modalTitle: '', modalTitle: '',
modalQuestion: '', modalQuestion: '',
modalOkTitle: '', modalOkTitle: '',
modalEvent: null,
username: '', username: '',
} }
}, },
watch: {
// roleSelected(newRole, oldRole) {
// if (newRole !== oldRole) {
// // this.setUserRole(newRole, oldRole)
// }
// },
},
methods: { methods: {
showModal() { showModal() {
this.username = `${this.item.firstName} ${this.item.lastName}` this.username = `${this.item.firstName} ${this.item.lastName}`
@ -80,7 +72,6 @@ export default {
newRole: this.roleSelected, // TODO get the text:Administrator instead of admin newRole: this.roleSelected, // TODO get the text:Administrator instead of admin
}) })
this.modalOkTitle = this.$t('overlay.changeUserRole.yes') this.modalOkTitle = this.$t('overlay.changeUserRole.yes')
this.modalEvent = this.setUserRole(this.roleSelected, this.currentRole)
}, },
setUserRole(newRole, oldRole) { setUserRole(newRole, oldRole) {
this.$apollo this.$apollo