feat: filter สถานะ ของลูกจ้าง

This commit is contained in:
Net 2024-06-17 10:02:51 +07:00
parent 253a7685f1
commit 22f673da08

View file

@ -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',
});
}
});
</script>