pramod_Task-#444 : Add "Assign Project" Feature in Employee Action Menu #191
@ -145,11 +145,11 @@ export const useProjectsByEmployee = ( employeeId ) =>
|
|||||||
setError(''); // clear previous error
|
setError(''); // clear previous error
|
||||||
const res = await ProjectRepository.getProjectsByEmployee(id);
|
const res = await ProjectRepository.getProjectsByEmployee(id);
|
||||||
setProjectList(res.data);
|
setProjectList(res.data);
|
||||||
cacheData('ProjectsByEmployee', { data: res.data, employeeId: id });
|
cacheData( 'ProjectsByEmployee', {data: res.data, employeeId: id} );
|
||||||
|
setLoading(false)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err?.message || 'Failed to fetch projects');
|
setError( err?.message || 'Failed to fetch projects' );
|
||||||
} finally {
|
setLoading(false)
|
||||||
setLoading(false);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ export const useProjectsByEmployee = ( employeeId ) =>
|
|||||||
return {
|
return {
|
||||||
projectList,
|
projectList,
|
||||||
loading,
|
loading,
|
||||||
error
|
error,
|
||||||
|
refetch : fetchProjects
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user