Employee dropdown list all staff from attendance + leave + accident

This commit is contained in:
IT Dog
2026-07-19 22:39:54 +08:00
parent 0cd8717320
commit 25ebf6da66
2 changed files with 39 additions and 2 deletions
+7 -1
View File
@@ -284,7 +284,13 @@ function LeavesTab() {
URL.revokeObjectURL(url)
}
const uniqueEmps = [...new Set(leaves.map(l => l.employee_name))].sort()
// Fetch employee list from /api/employees/list (UNION of attendance + leave + accident)
const [employees, setEmployees] = useState([])
useEffect(() => {
api.get('/api/employees/list')
.then(({ data }) => setEmployees(data.employees || []))
.catch(() => setEmployees([]))
}, [])
return (
<div className="space-y-4">