refactor: get stats customer

This commit is contained in:
Thanaphon Frappet 2024-10-28 13:28:48 +07:00
parent fef8bb4987
commit f5b43ccb27

View file

@ -379,6 +379,12 @@ async function fetchListCustomer(fetchStats = false) {
maxPageCustomer.value = Math.ceil(resultList.total / pageSize.value); maxPageCustomer.value = Math.ceil(resultList.total / pageSize.value);
listCustomer.value = resultList.result; listCustomer.value = resultList.result;
} }
if (fetchStats) {
statsCustomerType.value = await customerStore
.getStatsCustomer()
.then((value) => (value ? value : { CORP: 0, PERS: 0 }));
}
} }
async function fetchListEmployee(fetchStats = false) { async function fetchListEmployee(fetchStats = false) {