From 0511ed6d820433be9d79721c88f6191272205c17 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Wed, 8 Oct 2025 13:52:06 +0530 Subject: [PATCH] Changes in Attendance module for all projects. --- src/hooks/useAttendance.js | 1 - src/pages/Activities/AttendancePage.jsx | 65 +++++++++++------------ src/repositories/AttendanceRepository.jsx | 3 +- 3 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/hooks/useAttendance.js b/src/hooks/useAttendance.js index cbee0b8f..e4955f7e 100644 --- a/src/hooks/useAttendance.js +++ b/src/hooks/useAttendance.js @@ -32,7 +32,6 @@ export const useAttendance = (projectId, organizationId, includeInactive = false ); return response.data; }, - enabled: !!projectId, onError: (error) => { showToast(error.message || "Error while fetching Attendance", "error"); }, diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index 36414fe5..9fce3fec 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -210,41 +210,36 @@ const AttendancePage = () => {
- {selectedProject ? ( - <> - {activeTab === "all" && ( -
- -
- )} - {activeTab === "logs" && ( -
- -
- )} - {activeTab === "regularization" && DoRegularized && ( -
- -
- )} - - ) : ( -
- Please Select Project! -
- )} + + <> + {activeTab === "all" && ( +
+ +
+ )} + {activeTab === "logs" && ( +
+ +
+ )} + {activeTab === "regularization" && DoRegularized && ( +
+ +
+ )} +
diff --git a/src/repositories/AttendanceRepository.jsx b/src/repositories/AttendanceRepository.jsx index 8d2fce4e..15d18af8 100644 --- a/src/repositories/AttendanceRepository.jsx +++ b/src/repositories/AttendanceRepository.jsx @@ -4,9 +4,10 @@ const AttendanceRepository = { markAttendance: (data) => api.post("/api/attendance/record", data), getAttendance: (projectId, organizationId, includeInactive,date) => { - let url = `/api/attendance/project/team?projectId=${projectId}`; + let url = `/api/attendance/project/team`; const params = []; + if (projectId) params.push(`projectId=${projectId}`); if (organizationId) params.push(`organizationId=${organizationId}`); if (includeInactive) params.push(`includeInactive=${includeInactive}`); if (date) params.push(`date=${date}`);