Fixed bug of not getting data of correct project when going to attendance page
This commit is contained in:
parent
1bbc8fd422
commit
bb23d10996
@ -30,7 +30,7 @@ export const useAttendace =(projectId)=>{
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if ( projectId )
|
||||
if ( projectId && projectId != 1 )
|
||||
{
|
||||
fetchData(projectId);
|
||||
}
|
||||
|
@ -94,7 +94,12 @@ const AttendancePage = () => {
|
||||
useEffect(() => {
|
||||
setAttendances(attendance);
|
||||
}, [attendance]);
|
||||
|
||||
useEffect(()=>{
|
||||
if(selectedProject == 1){
|
||||
dispatch(setProjectId(loginUser?.projects[0]))
|
||||
console.log(loginUser?.projects);
|
||||
}
|
||||
},[selectedProject,loginUser?.projects])
|
||||
return (
|
||||
<>
|
||||
{isCreateModalOpen && modelConfig && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user