diff --git a/src/components/authentication/TheLogin.vue b/src/components/authentication/TheLogin.vue index 966c5d2..acb7b82 100644 --- a/src/components/authentication/TheLogin.vue +++ b/src/components/authentication/TheLogin.vue @@ -1,38 +1,37 @@ + @@ -298,19 +301,22 @@ import axios from "axios"; import useVuelidate from "@vuelidate/core"; import { required, email, minLength, maxLength } from "@vuelidate/validators"; import TermsAndConditionsDetails from "./TermsAndConditionsDetails.vue"; -import { useAuthenticationUserStore } from "@/store/modules/authentication" export default { name: "Register", components: { "terms-and-conditions-details": TermsAndConditionsDetails, }, + components: { + "terms-and-conditions-details": TermsAndConditionsDetails, + }, data() { return { v$: useVuelidate(), alertMessages: Array, isLoading: false, isDisplayTNC: false, + isDisplayTNC: false, form: { name: "", username: "", @@ -320,6 +326,7 @@ export default { notelbimbit: "", register_agree: null, alamat: "", + alamat: "", // password_confirmation: "", images: { file1: { @@ -350,6 +357,7 @@ export default { axios .post("/register", this.form) .then((response) => { + // console.log("doRegister", response); // console.log("doRegister", response); if (response.data.success == true) { localStorage.setItem("token", response.data.token); @@ -376,6 +384,7 @@ export default { } else if (response.data.success == false) { this.isLoading = false; this.isDisplayTNC = false; + this.isDisplayTNC = false; this.alertMessages = response.data.message; Object.values(this.alertMessages).forEach((val) => this.$toast.add({ @@ -392,6 +401,14 @@ export default { summary: "Failed to register!", detail: response.data.message, }); + } else if (response.data.success == "Staff") { + this.isLoading = false; + this.isDisplayTNC = false; + this.$toast.add({ + severity: "warn", + summary: "Failed to register!", + detail: response.data.message, + }); } else { this.isLoading = false; alert(response); @@ -414,25 +431,21 @@ export default { closeModalTNC() { this.isDisplayTNC = false; }, - toLogin() { - this.$router.push({ name: "login" }); - }, + readImage() {}, }, validations() { return { form: { name: { required }, username: { required }, - nokp: { - required, - minLengthValue: minLength(12), - maxLengthValue: maxLength(12), - }, + nokp: { required, minLengthValue: minLength(12), maxLengthValue: maxLength(12) }, password: { required, minLengthValue: minLength(8) }, email: { required, email }, notelbimbit: { required, minLengthValue: minLength(8) }, + notelbimbit: { required, minLengthValue: minLength(8) }, register_agree: { required }, alamat: { required }, + alamat: { required }, // images: { // file1: { // filename: { required }, @@ -448,23 +461,14 @@ export default {