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 Employee_cache = getCachedData("employeeProfile");
|
||||
if(!Employee_cache || Employee_cache.employeeId !== employeeId){
|
||||
|
||||
|
||||
|
||||
EmployeeRepository.getEmployeeProfile(employeeId)
|
||||
.then((response) => {
|
||||
setEmployees(response.data);
|
||||
@ -260,7 +259,9 @@ export const useEmployeeProfile =(employeeId)=>{
|
||||
};
|
||||
|
||||
useEffect(()=>{
|
||||
fetchData(employeeId);
|
||||
if(employeeId){
|
||||
fetchData(employeeId);
|
||||
}
|
||||
},[employeeId])
|
||||
|
||||
return {employee,loading,error}
|
||||
|
Loading…
x
Reference in New Issue
Block a user