Merge branch 'Feature_Task_Management' of https://git.marcoaiot.com/admin/marco.pms.web into Feature_Task_Management
This commit is contained in:
commit
453c53940f
@ -240,8 +240,7 @@ export const useEmployeeProfile =(employeeId)=>{
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const Employee_cache = getCachedData("employeeProfile");
|
const Employee_cache = getCachedData("employeeProfile");
|
||||||
if(!Employee_cache || Employee_cache.employeeId !== employeeId){
|
if(!Employee_cache || Employee_cache.employeeId !== employeeId){
|
||||||
|
|
||||||
|
|
||||||
EmployeeRepository.getEmployeeProfile(employeeId)
|
EmployeeRepository.getEmployeeProfile(employeeId)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
setEmployees(response.data);
|
setEmployees(response.data);
|
||||||
@ -260,7 +259,9 @@ export const useEmployeeProfile =(employeeId)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
fetchData(employeeId);
|
if(employeeId){
|
||||||
|
fetchData(employeeId);
|
||||||
|
}
|
||||||
},[employeeId])
|
},[employeeId])
|
||||||
|
|
||||||
return {employee,loading,error}
|
return {employee,loading,error}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user