Commit 668b1e31 authored by =sankoju Ravi's avatar =sankoju Ravi
parents 3e54a080 9e79fdc2
...@@ -3,7 +3,7 @@ import { useSelector, useDispatch } from "react-redux"; ...@@ -3,7 +3,7 @@ import { useSelector, useDispatch } from "react-redux";
import { useParams, useNavigate } from "react-router"; import { useParams, useNavigate } from "react-router";
import { base_url } from "../../utils/constants"; import { base_url } from "../../utils/constants";
import axios from 'axios'; import axios from 'axios';
import { fetchReportees } from "../../redux/reducers/reporteesSlice"; import { fetchReportees,setViewReportee } from "../../redux/reducers/reporteesSlice";
import {fetchReporteeActivities} from '../../redux/reducers/viewreporteeSlice' import {fetchReporteeActivities} from '../../redux/reducers/viewreporteeSlice'
import Accordion from "../../components/accordion"; import Accordion from "../../components/accordion";
import {scoreColor} from '../../utils/commonFunctions'; import {scoreColor} from '../../utils/commonFunctions';
...@@ -55,7 +55,7 @@ function Viewreportee() { ...@@ -55,7 +55,7 @@ function Viewreportee() {
page: 1, page: 1,
perPage: 10, perPage: 10,
}; };
dispatch(fetchReportees(data)); dispatch(fetchReportees(data))
} }
} }
...@@ -78,6 +78,12 @@ function Viewreportee() { ...@@ -78,6 +78,12 @@ function Viewreportee() {
useEffect(()=>{ useEffect(()=>{
if(reportees.length>0 && viewReportee) if(reportees.length>0 && viewReportee)
dispatch(fetchReporteeActivities({empId:viewReportee.empId})) dispatch(fetchReporteeActivities({empId:viewReportee.empId}))
},[reportees,viewReportee])
useEffect(()=>{
if(reportees.length){
dispatch(setViewReportee(viewReportee.empId))
}
},[reportees]) },[reportees])
...@@ -91,7 +97,7 @@ function Viewreportee() { ...@@ -91,7 +97,7 @@ function Viewreportee() {
} }
}, []); }, []);
if (viewReportee && reportees.length) if ( reportees.length && viewReportee)
return ( return (
<div className="p-4" > <div className="p-4" >
<div className="bg-white p-3 rounded-md"> <div className="bg-white p-3 rounded-md">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment