From c00b33926a7c522003414b3b682ce2793cf75139 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 6 May 2025 15:26:14 +0530 Subject: [PATCH] created new repo for attendanceByEmployee --- src/repositories/AttendanceRepository.jsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/repositories/AttendanceRepository.jsx b/src/repositories/AttendanceRepository.jsx index 22725fba..679001f8 100644 --- a/src/repositories/AttendanceRepository.jsx +++ b/src/repositories/AttendanceRepository.jsx @@ -19,7 +19,21 @@ const AttendanceRepository = { }, getAttendanceLogs: ( id ) => api.get( `api/attendance/log/attendance/${ id }` ), - getRegularizeList: (id)=> api.get(`api/attendance/regularize?projectId=${id}`) + getRegularizeList: ( id ) => api.get( `api/attendance/regularize?projectId=${ id }` ), + + getAttendanceByEmployee: ( employeeId, fromDate, toDate ) => + { + + let url = `api/Attendance/log/employee/${ employeeId }?` + if (fromDate) { + url += `&dateFrom=${fromDate}`; + } + + if (toDate) { + url += `&dateTo=${toDate}`; + } + return api.get(url) + }, }