developed
This commit is contained in:
parent
dc67117ad7
commit
2820e50d52
|
|
@ -417,7 +417,7 @@ const routes = [
|
|||
},
|
||||
{
|
||||
path: "profile",
|
||||
name: "top-menu-profile",
|
||||
name: "profile",
|
||||
component: Profile,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const useTopMenuStore = defineStore("topMenu", {
|
|||
{
|
||||
icon: "UserIcon",
|
||||
// pageName: "top-menu-dashboard-overview-1",
|
||||
pageName: "top-menu-profile",
|
||||
pageName: "profile",
|
||||
title: "Profile",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -256,6 +256,8 @@ import { useRoute } from "vue-router";
|
|||
import router from "@/router";
|
||||
import _ from "lodash";
|
||||
|
||||
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const maxDate = new Date();
|
||||
|
|
@ -301,8 +303,6 @@ const rules = {
|
|||
|
||||
const validate = useVuelidate(rules, toRefs(formData));
|
||||
|
||||
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
|
||||
|
||||
watch(date, (currentValue, oldValue) => {
|
||||
formData.account_date = currentValue;
|
||||
});
|
||||
|
|
@ -314,8 +314,6 @@ const onRegister = async () => {
|
|||
|
||||
if (validate.value.$invalid) return;
|
||||
|
||||
console.log("form valid");
|
||||
|
||||
try {
|
||||
isLoading.value = true;
|
||||
|
||||
|
|
@ -330,7 +328,7 @@ const onRegister = async () => {
|
|||
localStorage.removeItem("bankAccount");
|
||||
localStorage.setItem("bankAccount", JSON.stringify(formData));
|
||||
|
||||
router.push({ path: "/profile" });
|
||||
router.push({ name: "profile", params: { getAccount: false } });
|
||||
} catch (error) {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,6 +177,8 @@ import { useRoute } from "vue-router";
|
|||
import router from "@/router";
|
||||
import _ from "lodash";
|
||||
|
||||
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
|
@ -212,16 +214,12 @@ const rules = {
|
|||
|
||||
const validate = useVuelidate(rules, toRefs(formData));
|
||||
|
||||
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
|
||||
|
||||
const onRegister = async () => {
|
||||
validate.value.$touch();
|
||||
|
||||
// if form is invalid
|
||||
if (validate.value.$invalid) return;
|
||||
|
||||
console.log("form valid");
|
||||
|
||||
try {
|
||||
isLoading.value = true;
|
||||
// await new Promise((resolve) => setTimeout(resolve, 4000));
|
||||
|
|
@ -236,7 +234,7 @@ const onRegister = async () => {
|
|||
localStorage.removeItem("contacts");
|
||||
localStorage.setItem("contacts", JSON.stringify(formData));
|
||||
|
||||
router.push({ path: "/profile" });
|
||||
router.push({ name: "profile", params: { getAccount: false } });
|
||||
} catch (error) {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,14 +200,18 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import router from "@/router";
|
||||
import { fetchWrapper } from "@/api";
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
const contacts = reactive({});
|
||||
|
||||
const bankAccount = reactive({});
|
||||
|
||||
const onEdit = (name, params) => {
|
||||
|
|
@ -234,6 +238,10 @@ const getAccount = async () => {
|
|||
};
|
||||
|
||||
onMounted(async () => {
|
||||
const params = route.params;
|
||||
|
||||
console.log("param: ", params.getAccount);
|
||||
|
||||
await getAccount();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue