From 276dc233c1a05792934e24073b61e0fab8bc0842 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 23 Nov 2024 00:33:30 +0100 Subject: [PATCH] perf: remove almost fonseca code --- src/pages/Customer/Card/CustomerAddress.vue | 32 ++-- src/pages/Customer/Card/CustomerBasicData.vue | 7 +- .../Customer/Card/CustomerBillingData.vue | 7 +- .../Customer/Card/CustomerCreditOpinion.vue | 16 -- .../Customer/Card/CustomerFiscalData.vue | 1 - src/pages/Customer/Card/CustomerUnpaid.vue | 174 +++++------------- src/pages/Customer/Card/CustomerWebAccess.vue | 5 +- .../Customer/Card/CustomerWebPayment.vue | 110 +++++------ .../components/CustomerAddressCreate.vue | 30 ++- .../components/CustomerAddressEdit.vue | 2 +- 10 files changed, 121 insertions(+), 263 deletions(-) diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index 3ae5fbafb..da21f78b0 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -2,6 +2,7 @@ import { onBeforeMount, ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; +import VnPaginate from 'src/components/ui/VnPaginate.vue'; import axios from 'axios'; @@ -52,7 +53,7 @@ const addressFilter = { onBeforeMount(() => { const { id } = route.params; - getAddressesData(id); + // getAddressesData(id); getClientData(id); }); @@ -60,22 +61,14 @@ watch( () => route.params.id, (newValue) => { if (!newValue) return; - getAddressesData(newValue); + // getAddressesData(newValue); getClientData(newValue); } ); - -const getAddressesData = async (id) => { - try { - const { data } = await axios.get(`Clients/${id}/addresses`, { - params: { filter: JSON.stringify(addressFilter) }, - }); - addresses.value = data; - sortAddresses(); - } catch (error) { - return error; - } -}; +async function onFetch(data) { + addresses.value = data; + sortAddresses(); +} const getClientData = async (id) => { try { @@ -125,7 +118,16 @@ const toCustomerAddressEdit = (addressId) => {