From 069dcce9b68eb55db0997c4fb14720d9441193d1 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:36:36 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B8=84=E0=B8=B3=E0=B8=99=E0=B8=A7?= =?UTF-8?q?=E0=B8=99=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=9C=E0=B8=B4?= =?UTF-8?q?=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../03_customer-management/CustomerInfoComponent.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/03_customer-management/CustomerInfoComponent.vue b/src/components/03_customer-management/CustomerInfoComponent.vue index 9763354b..84e01f9b 100644 --- a/src/components/03_customer-management/CustomerInfoComponent.vue +++ b/src/components/03_customer-management/CustomerInfoComponent.vue @@ -4,15 +4,11 @@ import AppBox from 'components/app/AppBox.vue'; import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue'; import { onMounted } from 'vue'; import useCustomerStore from 'src/stores/customer'; -import { - CustomerBranch, - Customer, - CustomerType, -} from 'src/stores/customer/types'; +import { CustomerBranch, CustomerType } from 'src/stores/customer/types'; import { watch } from 'vue'; const userCustomer = useCustomerStore(); -const { fetchListById, fetchListBranch } = userCustomer; +const { fetchListBranch } = userCustomer; const inputSearch = ref(''); @@ -63,19 +59,21 @@ onMounted(async () => { }); if (result) { currentCustomerName.value = 'dasd'; - + maxPageBranch.value = Math.ceil(result.total / pageSizeBranch.value); branch.value = result.result; } }); watch(currentPageBranch, async () => { const resultList = await fetchListBranch({ + customerId: prop.customerId, page: currentPageBranch.value, pageSize: pageSizeBranch.value, }); if (resultList) { currentPageBranch.value = resultList.page; + maxPageBranch.value = Math.ceil(resultList.total / pageSizeBranch.value); branch.value = resultList.result; }