From 4d6bc21fb4613aeb55a03a5cad617ac9323d0827 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 15 Jun 2021 14:18:07 +0200 Subject: [PATCH 1/4] Change Password Form --- frontend/src/apis/loginAPI.js | 6 ++-- frontend/src/locales/de.json | 4 ++- frontend/src/locales/en.json | 4 ++- .../src/views/Layout/DashboardLayout_gdd.vue | 3 -- .../UserProfile/UserCard_FormUserPasswort.vue | 30 ++++++++++++------- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js index d9d0b2b9c..c72965ea5 100644 --- a/frontend/src/apis/loginAPI.js +++ b/frontend/src/apis/loginAPI.js @@ -34,7 +34,7 @@ const apiPost = async (url, payload) => { return { success: true, result: result.error } } if (result.data.state !== 'success') { - throw new Error(result.data.msg) + throw new Error(result.data.errors) } return { success: true, result } } catch (error) { @@ -113,8 +113,8 @@ const loginAPI = { session_id: sessionId, email, update: { - 'User.password': password, - 'User.passwordNew': passwordNew, + 'User.password_old': password, + 'User.password': passwordNew, }, } return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 8554996bb..4d85269c5 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -39,6 +39,7 @@ "password_new":"neues Passwort", "password_new_repeat":"neues Passwort wiederholen", "change": "ändern", + "change-password": "Passwort ändern", "amount":"Betrag", "memo":"Nachricht für den Empfänger", "message":"Nachricht", @@ -64,7 +65,8 @@ "change_username_info": "Einmal gespeichert, kann der Username ncht mehr geändert werden!" }, "error": { - "error":"Fehler" + "error":"Fehler", + "change-password": "Fehler beim Ändern des Passworts" }, "transaction":{ "show_all":"Alle {count} Transaktionen ansehen", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 7b97c2240..987605bd8 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -39,6 +39,7 @@ "password_new":"New password", "password_new_repeat":"Repeat new password", "change": "change", + "change-password": "Change password", "amount":"Amount", "memo":"Message for the recipient", "message":"Message", @@ -64,7 +65,8 @@ "change_username_info": "Once saved, the username cannot be changed again!" }, "error": { - "error":"Error" + "error":"Error", + "change-password": "Error while changing password" }, "transaction":{ "show_all":"View all {count} transactions.", diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 4d65aed70..9990b91f2 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -144,9 +144,6 @@ export default { mounted() { this.initScrollbar() }, - created() { - this.updateTransactions({ firstPage: 1, items: 5 }) - }, }