Changes in Attendance module for all projects.
This commit is contained in:
parent
bc933f4c64
commit
0511ed6d82
@ -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");
|
||||
},
|
||||
|
@ -210,41 +210,36 @@ const AttendancePage = () => {
|
||||
</div>
|
||||
|
||||
<div className="tab-content attedanceTabs py-0 px-1 px-sm-3 pb-10">
|
||||
{selectedProject ? (
|
||||
<>
|
||||
{activeTab === "all" && (
|
||||
<div className="tab-pane fade show active py-0 mx-5">
|
||||
<Attendance
|
||||
handleModalData={handleModalData}
|
||||
getRole={getRole}
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "logs" && (
|
||||
<div className="tab-pane fade show active py-0">
|
||||
<AttendanceLog
|
||||
handleModalData={handleModalData}
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "regularization" && DoRegularized && (
|
||||
<div className="tab-pane fade show active py-0">
|
||||
<Regularization
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<div className="py-2">
|
||||
<small>Please Select Project!</small>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<>
|
||||
{activeTab === "all" && (
|
||||
<div className="tab-pane fade show active py-0 mx-5">
|
||||
<Attendance
|
||||
handleModalData={handleModalData}
|
||||
getRole={getRole}
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "logs" && (
|
||||
<div className="tab-pane fade show active py-0">
|
||||
<AttendanceLog
|
||||
handleModalData={handleModalData}
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "regularization" && DoRegularized && (
|
||||
<div className="tab-pane fade show active py-0">
|
||||
<Regularization
|
||||
searchTerm={searchTerm}
|
||||
organizationId={appliedFilters.selectedOrganization}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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}`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user