From 22f673da08201bba37163bfcad385cd951102ca7 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:02:51 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20filter=20=E0=B8=AA=E0=B8=96=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=B0=20=E0=B8=82=E0=B8=AD=E0=B8=87=E0=B8=A5?= =?UTF-8?q?=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/03_customer-management/MainPage.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 34708618..2404e64f 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -700,7 +700,10 @@ async function fetchListCustomer() { } } -async function fetchListEmployee(param?: { gender: string }) { +async function fetchListEmployee(param?: { + gender?: string; + status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' | undefined; +}) { const resultListEmployee = await employeeStore.fetchList(param); if (resultListEmployee) { currentPageEmployee.value = resultListEmployee.page; @@ -1145,6 +1148,15 @@ watch(genderselector, async (gender) => { watch(currentStatus, async () => { if (selectorLabel.value === 'EMPLOYER') { await fetchListCustomer(); + } else { + await fetchListEmployee({ + status: + currentStatus.value === 'All' + ? undefined + : currentStatus.value === 'ACTIVE' + ? 'ACTIVE' + : 'INACTIVE', + }); } });