From 519d5fec2f84624de5efa08c0b1d4707003f6a09 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 9 Jun 2021 10:21:58 +0200 Subject: [PATCH] username change and save --- frontend/src/apis/loginAPI.js | 2 - .../UserProfile/UserCard_FormUsername.vue | 62 ++++++++++++------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js index 3ba7b576a..2eeec754e 100644 --- a/frontend/src/apis/loginAPI.js +++ b/frontend/src/apis/loginAPI.js @@ -121,8 +121,6 @@ const loginAPI = { return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) }, changeUsernameProfile: async (sessionId, email, username) => { - console.log('changeUsernameProfile', username) - const payload = { session_id: sessionId, email, diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue index 371d6a2e9..445c69f8e 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue @@ -1,42 +1,58 @@ @@ -59,15 +75,15 @@ export default { }, methods: { async onSubmit() { - console.log('onSubmit', this.form.username) const result = await loginAPI.changeUsernameProfile( this.$store.state.sessionId, - this.$store.state.email, + this.$store.state.email, this.form.username, ) if (result.success) { this.$store.commit('username', this.form.username) - this.editUserdata = true + this.editUserdata = this.editUsername = !this.editUsername + alert('Dein Username wurde geƤndert.') } else { alert(result.result.message) }