From f5b43ccb276c1c662d7bf719b6bd2cc69cd20ef7 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Mon, 28 Oct 2024 13:28:48 +0700 Subject: [PATCH] refactor: get stats customer --- src/pages/03_customer-management/MainPage.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 53363d20..15b3149d 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -379,6 +379,12 @@ async function fetchListCustomer(fetchStats = false) { maxPageCustomer.value = Math.ceil(resultList.total / pageSize.value); listCustomer.value = resultList.result; } + + if (fetchStats) { + statsCustomerType.value = await customerStore + .getStatsCustomer() + .then((value) => (value ? value : { CORP: 0, PERS: 0 })); + } } async function fetchListEmployee(fetchStats = false) {