Employee dropdown list all staff from attendance + leave + accident
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user