Fixed bug of not getting data of correct project when going to attendance page

This commit is contained in:
ashutosh.nehete 2025-05-04 09:32:12 +05:30
parent 1bbc8fd422
commit bb23d10996
2 changed files with 7 additions and 2 deletions

View File

@ -30,7 +30,7 @@ export const useAttendace =(projectId)=>{
useEffect(()=>{
if ( projectId )
if ( projectId && projectId != 1 )
{
fetchData(projectId);
}

View File

@ -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 && (