clean up unused code
This commit is contained in:
parent
6b241b14de
commit
f42b2d2724
@ -39,9 +39,6 @@ export const useAttendace =(projectId)=>{
|
|||||||
return {attendance,loading,error}
|
return {attendance,loading,error}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const useEmployeeAttendacesLog = (id) => {
|
export const useEmployeeAttendacesLog = (id) => {
|
||||||
const [logs, setLogs] = useState([]);
|
const [logs, setLogs] = useState([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@ -76,8 +73,6 @@ export const useEmployeeAttendacesLog = (id) => {
|
|||||||
return { logs, loading, error };
|
return { logs, loading, error };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const useRegularizationRequests = ( projectId ) =>
|
export const useRegularizationRequests = ( projectId ) =>
|
||||||
{
|
{
|
||||||
const [regularizes, setregularizes] = useState([]);
|
const [regularizes, setregularizes] = useState([]);
|
||||||
@ -91,7 +86,6 @@ export const useRegularizationRequests = ( projectId ) =>
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
AttendanceRepository.getRegularizeList(projectId).then((response)=>{
|
AttendanceRepository.getRegularizeList(projectId).then((response)=>{
|
||||||
setregularizes( response.data )
|
setregularizes( response.data )
|
||||||
console.log(response.data)
|
|
||||||
cacheData("regularizedList", { data: response.data, projectId })
|
cacheData("regularizedList", { data: response.data, projectId })
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
|
|||||||
@ -29,67 +29,6 @@ const useAttendanceStatus = (attendanceData) => {
|
|||||||
|
|
||||||
const { checkInTime, checkOutTime, activity } = attendanceData;
|
const { checkInTime, checkOutTime, activity } = attendanceData;
|
||||||
|
|
||||||
// if (activity === 0 && checkInTime === null && checkOutTime === null) {
|
|
||||||
// setStatus({
|
|
||||||
// status: "Check-In",
|
|
||||||
// action: ACTIONS.CHECK_IN,
|
|
||||||
// disabled: false,
|
|
||||||
// text: "Check In",
|
|
||||||
// color: 'btn-primary',
|
|
||||||
// });
|
|
||||||
// } else if (activity === 0 && checkInTime !== null && checkOutTime === null && !timeElapsed(checkInTime,THRESH_HOLD)) {
|
|
||||||
// setStatus({
|
|
||||||
// status: "Check-Out",
|
|
||||||
// action: ACTIONS.CHECK_OUT,
|
|
||||||
// disabled: false,
|
|
||||||
// text: "Check Out",
|
|
||||||
// color: 'btn-primary',
|
|
||||||
// });
|
|
||||||
|
|
||||||
// }else if (activity === 0 && checkInTime !== null && checkOutTime === null && timeElapsed(checkInTime,THRESH_HOLD)) {
|
|
||||||
// setStatus({
|
|
||||||
// status: "Request Regularize",
|
|
||||||
// action: ACTIONS.REGULARIZATION,
|
|
||||||
// disabled: false,
|
|
||||||
// text: "Request Regularize",
|
|
||||||
// color: 'btn-warning',
|
|
||||||
// });
|
|
||||||
|
|
||||||
// } else if (activity === 1 && checkInTime !== null && checkOutTime === null || checkOutTime !== null && !timeElapsed(checkInTime,THRESH_HOLD)) {
|
|
||||||
// setStatus({
|
|
||||||
// status: "Check-In",
|
|
||||||
// action: ACTIONS.CHECK_IN,
|
|
||||||
// disabled: false,
|
|
||||||
// text: "Check-In",
|
|
||||||
// color: 'btn-primary',
|
|
||||||
// })
|
|
||||||
|
|
||||||
// }else if (activity === 2 && checkInTime !== null && (checkOutTime !== null || checkOutTime === null ) ) {
|
|
||||||
// setStatus({
|
|
||||||
// status: "Requested",
|
|
||||||
// action: ACTIONS.REQUESTED,
|
|
||||||
// disabled: true,
|
|
||||||
// text: "Requested",
|
|
||||||
// color: 'btn-info',
|
|
||||||
// });
|
|
||||||
// } else if(activity === 4 && checkInTime !== null && checkOutTime !== null && !timeElapsed(checkInTime)){
|
|
||||||
// setStatus({
|
|
||||||
// status: "Approved",
|
|
||||||
// action: ACTIONS.APPROVED,
|
|
||||||
// disabled: true,
|
|
||||||
// text: "Approved",
|
|
||||||
// color: 'btn-success',
|
|
||||||
// });
|
|
||||||
// }else{
|
|
||||||
// setStatus({
|
|
||||||
// status: "Rejected",
|
|
||||||
// action: ACTIONS.REJECTED,
|
|
||||||
// disabled: true,
|
|
||||||
// text: "Rejected",
|
|
||||||
// color: 'btn-danger',
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
if(activity === 0 && checkInTime === null && checkOutTime === null){
|
if(activity === 0 && checkInTime === null && checkOutTime === null){
|
||||||
setStatus({
|
setStatus({
|
||||||
@ -172,13 +111,6 @@ const useAttendanceStatus = (attendanceData) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, [attendanceData]);
|
}, [attendanceData]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user