Add the setTimeOut leave and adjustment api call

This commit is contained in:
JaiPandey425 2025-12-04 12:06:45 +05:30
parent 9eeb14ffcd
commit 52e45f8328
1 changed files with 14 additions and 7 deletions

View File

@ -95,18 +95,25 @@ console.log("projectSummary46" , projectSummary)
// Combined refresh function
const handleRefresh = async () => {
if (activeTab === "leave") {
await fetchLeaves();
} else {
await fetchAdjustments();
}
// if (activeTab === "leave") {
// await fetchLeaves();
// } else {
// await fetchAdjustments();
// }
fetchLeaves();
setTimeout(() => {
fetchAdjustments();
}, 0);
setLastRefreshed(new Date());
};
// Initial data fetch
useEffect(() => {
fetchLeaves();
setTimeout(() => {
fetchAdjustments();
}, 0);
setLastRefreshed(new Date());
}, []);