@@ -56,7 +43,7 @@ import { defineComponent } from "vue";
import axios from "axios";
import { notify } from "@kyvg/vue3-notification";
import useValidate from "@vuelidate/core";
-import { required, minLength } from "@vuelidate/validators";
+import { required, minLength, helpers } from "@vuelidate/validators";
import Header from "../../layouts/headers/headerauth.vue";
import authHeader from "../../services/auth.header";
@@ -82,7 +69,7 @@ export default defineComponent({
return {
ChangePasswordForm: {
new_password: { required, minLength: minLength(6) },
- password_confirm: { required, minLength: minLength(6) },
+ password_confirm: { required, minLength: minLength(6), sameAsPassword: helpers.withMessage('Passwords must match', (value: string) => value === this.ChangePasswordForm.new_password) },
},
};
},
@@ -118,13 +105,14 @@ export default defineComponent({
withCredentials: true,
headers: authHeader(),
}).then((response:any) => {
+ console.log(response)
if (response.data.ok) {
notify({
title: "Authorization",
- text: "Success!",
+ text: "Password changed",
type: "success",
});
- this.$router.push({ name: "login" });
+ this.$router.push({ name: "home" });
}
if (response.data.error) {
notify({
@@ -149,6 +137,7 @@ export default defineComponent({
new_password: this.ChangePasswordForm.new_password,
password_confirm: this.ChangePasswordForm.password_confirm,
};
+
this.v$.$validate(); // checks all inputs
if (this.v$.$invalid) {
notify({
@@ -163,4 +152,4 @@ export default defineComponent({
},
},
});
-
\ No newline at end of file
+
diff --git a/src/pages/customer/ServicePlanEdit.vue b/src/pages/customer/ServicePlanEdit.vue
new file mode 100644
index 0000000..95ba63a
--- /dev/null
+++ b/src/pages/customer/ServicePlanEdit.vue
@@ -0,0 +1,312 @@
+
+
+
+
+
+
+
+ - Home
+ - Customers
+ -
+ {{ customerName }}
+
+ - Service Plan
+
+
+
+
+
+ Service Plan: {{ customerName }}
+
+
+ Back to Profile
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/customer/edit.vue b/src/pages/customer/edit.vue
index 679086a..543f10a 100755
--- a/src/pages/customer/edit.vue
+++ b/src/pages/customer/edit.vue
@@ -143,6 +143,8 @@