From 7858a465fb2f764a5ee54766651bf0e874ab8143 Mon Sep 17 00:00:00 2001 From: shikha Date: Tue, 18 Feb 2020 12:34:20 +0530 Subject: [PATCH] change api of change password and put validations on password fields --- src/pages/Administrator/resetPassword.vue | 40 +++++++++++++++++++++++-------- src/router/paths.js | 2 +- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/pages/Administrator/resetPassword.vue b/src/pages/Administrator/resetPassword.vue index a32c654..fd95099 100644 --- a/src/pages/Administrator/resetPassword.vue +++ b/src/pages/Administrator/resetPassword.vue @@ -5,14 +5,14 @@ - Reset Password + Change Password - + > --> + @@ -52,13 +69,13 @@ Reset Password + >Change Password !!v || "User is required"], userNameRule: [v => !!v || "User Name is required"], + oldPasswordRule: [v => !!v || "Old Password is required"], newPasswordRule: [v => !!v || "New Password is required"], rePasswordRule: [v => !!v || "Re-Password is required"] }; @@ -110,12 +130,12 @@ export default { reset() { if ( this.$refs.form.validate() && - this.resetPassword.confirmPassword === this.resetPassword.newPassword + this.resetPassword.oldPassword === this.resetPassword.oldPassword ) { this.loading = true; - this.resetPassword.roleName = this.resetPassword.name; + this.resetPassword.newPassword = this.resetPassword.newPassword; http() - .put("/resetPasswordOfUsers", this.resetPassword, { + .put("/change-password", this.resetPassword, { headers: { Authorization: "Bearer " + this.token } }) .then(response => { diff --git a/src/router/paths.js b/src/router/paths.js index f47f44d..478ff9f 100644 --- a/src/router/paths.js +++ b/src/router/paths.js @@ -600,7 +600,7 @@ export default [{ { path: '/resetPassword', meta: {}, - name: 'Reset Password', + name: 'Change Password', props: (route) => ({ type: route.query.type }), component: () => import ( -- 2.0.0