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(()=>{
|
useEffect(()=>{
|
||||||
if ( projectId )
|
if ( projectId && projectId != 1 )
|
||||||
{
|
{
|
||||||
fetchData(projectId);
|
fetchData(projectId);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,12 @@ const AttendancePage = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAttendances(attendance);
|
setAttendances(attendance);
|
||||||
}, [attendance]);
|
}, [attendance]);
|
||||||
|
useEffect(()=>{
|
||||||
|
if(selectedProject == 1){
|
||||||
|
dispatch(setProjectId(loginUser?.projects[0]))
|
||||||
|
console.log(loginUser?.projects);
|
||||||
|
}
|
||||||
|
},[selectedProject,loginUser?.projects])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isCreateModalOpen && modelConfig && (
|
{isCreateModalOpen && modelConfig && (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user