From 56153893e86dfe49209d5e5f57f555a671d5d51b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 17 Jun 2021 13:17:04 +0200 Subject: [PATCH] change frorntend for new API call --- frontend/src/apis/loginAPI.js | 2 +- frontend/src/views/Pages/ResetPassword.spec.js | 5 +++++ frontend/src/views/Pages/ResetPassword.vue | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js index 5b55d3a5b..a1befd58a 100644 --- a/frontend/src/apis/loginAPI.js +++ b/frontend/src/apis/loginAPI.js @@ -106,7 +106,7 @@ const loginAPI = { 'User.password': password, }, } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + return apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) }, changePasswordProfile: async (sessionId, email, password, passwordNew) => { const payload = { diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index 261a1a0c0..14038e676 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -56,6 +56,11 @@ describe('ResetPassword', () => { $router: { push: routerPushMock, }, + $loading: { + show: jest.fn(() => { + return { hide: jest.fn() } + }), + }, } const stubs = { diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 1e1192976..1f1cbdbc0 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -154,6 +154,9 @@ export default { } }, async authenticate() { + const loader = this.$loading.show({ + container: this.$refs.submitButton, + }) const optin = this.$route.params.optin const result = await loginAPI.loginViaEmailVerificationCode(optin) if (result.success) { @@ -163,6 +166,7 @@ export default { } else { this.$toast.error(result.result.message) } + loader.hide() }, }, computed: {