bug fixed

This commit is contained in:
Komek Hayytnazarov 2022-09-26 11:57:17 +05:00
parent b3d176738e
commit 68a1b8bbce
2 changed files with 28 additions and 7 deletions

View File

@ -354,7 +354,7 @@ const onRegister = async () => {
formData.date_of_birth = year + "-" + month + "-" + day;
console.log("formData: ", formData.date_of_birth);
console.log("formData: ", formData);
validate.value.$touch();
@ -366,7 +366,7 @@ const onRegister = async () => {
isLoading.value = true;
const response = await fetchWrapper.put(
`${baseUrl}/account/profile`,
`${baseUrl}/account/profilee`,
formData
);

View File

@ -237,7 +237,13 @@
href="javascript:;"
@click.prevent="onLegalBtnTapped"
class="btn btn-primary"
><EditIcon class="w-4 h-4 mr-3" /> {{ legalBtnTitle }}</a
><EditIcon class="w-4 h-4 mr-3" /> {{ legalBtnTitle }}
<LoadingIcon
icon="oval"
color="white"
class="w-4 h-4 ml-2"
v-if="isLegalBtnLoading"
/> </a
>
</div>
</div>
@ -291,21 +297,36 @@ const legalNumber = ref("");
const legalCanApply = ref(false);
const legalCanExtend = ref(false);
const legalBtnTitle = ref("");
const isLegalBtnLoading = ref(false);
const onEdit = (name, params) => {
router.push({ name: name, params: params });
};
const onLegalBtnTapped = () => {
const onLegalBtnTapped = async () => {
console.log("onLegalBtnTapped");
if (
legalAppStatus.value == "" ||
legalExpiresAt.value == null ||
legalCanExtend.value
) {
// call create
const response = await createApplication();
if (response) router.push({ name: "documents" });
} else router.push({ name: "documents" });
};
const createApplication = async () => {
isLegalBtnLoading.value = true;
try {
const response = await fetchWrapper.get(`${baseUrl}/application/new`);
const data = response.data;
isLegalBtnLoading.value = false;
return true;
} catch (error) {
isLegalBtnLoading.value = false;
return false;
}
router.push({ name: "documents" });
};
const prepareLegalBtnTitle = () => {
@ -427,4 +448,4 @@ legal_number
onMounted(async () => {
await getAccount();
});
</script>
</script>