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) => {