summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/UserModuleEdit.vue
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-26 10:00:29 +0100
committerJannik Schönartz2019-02-26 10:00:29 +0100
commitf4d4c1ee3725bbae32199fba99106fbd4d39d31b (patch)
treeda8b2db3afc36500afd7be327cb396916f487eb4 /webapp/src/components/UserModuleEdit.vue
parent[permissionmanager] Fix security bug: Code was executed weather the user had ... (diff)
downloadbas-f4d4c1ee3725bbae32199fba99106fbd4d39d31b.tar.gz
bas-f4d4c1ee3725bbae32199fba99106fbd4d39d31b.tar.xz
bas-f4d4c1ee3725bbae32199fba99106fbd4d39d31b.zip
[webapp/dashboard] User data now stores in the global storage & [usermanagement] fix 'username already exist' error not workling properly
Diffstat (limited to 'webapp/src/components/UserModuleEdit.vue')
-rw-r--r--webapp/src/components/UserModuleEdit.vue19
1 files changed, 11 insertions, 8 deletions
diff --git a/webapp/src/components/UserModuleEdit.vue b/webapp/src/components/UserModuleEdit.vue
index e989c11..e4f3cb0 100644
--- a/webapp/src/components/UserModuleEdit.vue
+++ b/webapp/src/components/UserModuleEdit.vue
@@ -22,7 +22,7 @@
</v-card-title>
<v-card-text style="height: 100%;">
<div class="edit-user">
- <signup v-model="user" ref="editComponent" :id="dialog.info.id"></signup>
+ <signup v-model="userForm" ref="editComponent" :id="dialog.info.id"></signup>
</div>
</v-card-text>
<v-divider></v-divider>
@@ -35,7 +35,7 @@
</template>
<script>
-import { mapState } from 'vuex'
+import { mapState, mapMutations, mapGetters } from 'vuex'
import signup from '@/components/UserCreateForm'
export default {
@@ -45,13 +45,15 @@ export default {
},
data () {
return {
- user: { }
+ userForm: { }
}
},
computed: {
- ...mapState('users', ['dialog'])
+ ...mapState('users', ['dialog']),
+ ...mapGetters(['user'])
},
methods: {
+ ...mapMutations('setUserFullName', 'setUserName'),
setDialog (data) {
this.$store.commit('users/setDialog', data)
},
@@ -62,11 +64,12 @@ export default {
url += '/' + this.dialog.info.id
}
this.$http.post(url, {
- username: this.user.username,
- password: this.user.password,
- name: this.user.name,
- email: this.user.email
+ username: this.userForm.username,
+ password: this.userForm.password,
+ name: this.userForm.name,
+ email: this.userForm.email
}).then(response => {
+ if (this.dialog.info.id === this.user.id) this.$store.dispatch('loadUser')
this.$store.dispatch('users/loadData')
this.setDialog({ show: false })
this.$snackbar({ color: 'success', text: this.dialog.info.id ? this.$t('userUpdated') : this.$t('userCreated') })