From d61c86dd1c7caf6dfdb5c3c941877a61011b9015 Mon Sep 17 00:00:00 2001 From: sajjad Date: Sat, 27 Nov 2021 16:40:56 +0330 Subject: [PATCH] fix --- src/abstraction/repository/authRepository.js | 4 ++-- src/components/Global/Section/SideBar.vue | 10 ++++++---- src/router/url.js | 2 +- src/views/PasswordReset.vue | 17 ++++++++--------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/abstraction/repository/authRepository.js b/src/abstraction/repository/authRepository.js index 71cdf0e..b26b010 100644 --- a/src/abstraction/repository/authRepository.js +++ b/src/abstraction/repository/authRepository.js @@ -23,9 +23,9 @@ export default class AuthRepository { return response.data; } } - async forgetPassword(data) { + async forgotPassword(data) { let json = setData(data); - let response = await axios.post(url("forgetPassword"), json); + let response = await axios.post(url("forgotPassword"), json); return getJson(response.data.data) } async resetPassword(data) { diff --git a/src/components/Global/Section/SideBar.vue b/src/components/Global/Section/SideBar.vue index f443920..454f4d1 100644 --- a/src/components/Global/Section/SideBar.vue +++ b/src/components/Global/Section/SideBar.vue @@ -72,7 +72,8 @@ export default { id: 4, text: "programs", link: "programs", - active: this.$route.name === "programs", + active: + this.$route.name === "programs" || this.$route.name === "addProgram", }, { id: 5, @@ -84,13 +85,14 @@ export default { id: 6, text: "products", link: "products", - active: this.$route.name === "products", + active: this.$route.name === "products" || this.$route.name === "addProduct", }, { id: 7, text: "workouts", link: "workouts", - active: this.$route.name === "workouts", + active: + this.$route.name === "workouts" || this.$route.name === "addWorkout", }, ]) : this.type === "trainer" @@ -156,4 +158,4 @@ export default { }, }, }; - \ No newline at end of file + diff --git a/src/router/url.js b/src/router/url.js index 2a4b60c..46903c9 100644 --- a/src/router/url.js +++ b/src/router/url.js @@ -4,7 +4,7 @@ const urls = { // authentication login: "auth/login", register: "auth/register", - forgetPassword: "auth/forget-password", + forgotPassword: "auth/forget-password", logout: "auth/logout", // programs indexProgram: "admin/courses", diff --git a/src/views/PasswordReset.vue b/src/views/PasswordReset.vue index 13d2f51..99eaca3 100644 --- a/src/views/PasswordReset.vue +++ b/src/views/PasswordReset.vue @@ -9,13 +9,11 @@ @@ -69,14 +67,15 @@ import AuthRepository from "../abstraction/repository/authRepository"; export default { components: { AuthBasic, - }, + }, data: () => ({ form: {}, }), methods: { - async resetPassword() { + async forgotPassword() { let repository = new AuthRepository(); - await repository.resetPassword(this.form); + await repository.forgotPassword(this.form); + this.$router.push({ name: "login" }); }, }, };