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; }