Compare commits
4 Commits
c45130b611
...
4a5d9c05e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a5d9c05e6 | ||
|
|
60232cf121 | ||
|
|
9e32986969 | ||
|
|
aa6ddd7fe9 |
@ -11,7 +11,7 @@ const Regularization = ( { handleRequest} ) =>
|
||||
{
|
||||
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||
const [ regularizesList, setregularizedList ] = useState( [] )
|
||||
const { regularizes, loading,error} = useRegularizationRequests(selectedProject)
|
||||
const { regularizes, loading,error,refetch} = useRegularizationRequests(selectedProject)
|
||||
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ const Regularization = ( { handleRequest} ) =>
|
||||
<td>{att.checkOutTime ? convertShortTime(att.checkOutTime):"--"}</td>
|
||||
<td className='text-center ' >
|
||||
{/* <div className='d-flex justify-content-center align-items-center gap-3'> */}
|
||||
<RegularizationActions attendanceData={att} handleRequest={handleRequest} />
|
||||
<RegularizationActions attendanceData={att} handleRequest={handleRequest} refresh={refetch } />
|
||||
{/* </div> */}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -5,9 +5,10 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||
import { usePositionTracker } from '../../hooks/usePositionTracker';
|
||||
import {markCurrentAttendance} from '../../slices/apiSlice/attendanceAllSlice';
|
||||
import {cacheData, getCachedData} from '../../slices/apiDataManager';
|
||||
import showToast from '../../services/toastService';
|
||||
|
||||
|
||||
const RegularizationActions = ({attendanceData,handleRequest}) => {
|
||||
const RegularizationActions = ({attendanceData,handleRequest,refresh}) => {
|
||||
const [status,setStatus] = useState()
|
||||
const [loadingApprove,setLoadingForApprove] = useState(false)
|
||||
const [loadingReject,setLoadingForReject] = useState(false)
|
||||
@ -17,7 +18,7 @@ const {latitude,longitude} = usePositionTracker();
|
||||
const dispatch = useDispatch()
|
||||
|
||||
const handleRegularization =(request_attendance,IsReqularize)=>{
|
||||
debugger
|
||||
|
||||
if(IsReqularize){
|
||||
setLoadingForApprove(true)
|
||||
}else{
|
||||
@ -47,7 +48,11 @@ const dispatch = useDispatch()
|
||||
cacheData("regularizedList",{data:updatedata,projectId:projectId})
|
||||
setLoadingForApprove( false )
|
||||
setLoadingForReject( false )
|
||||
})
|
||||
refresh()
|
||||
}).catch( ( error ) =>
|
||||
{
|
||||
showToast(error.message,"error")
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
@ -67,7 +72,7 @@ const dispatch = useDispatch()
|
||||
|
||||
|
||||
return (
|
||||
<div className="w-auto d-flex gap-2 align-items-center justify-content-between">
|
||||
<div className="w-auto d-flex gap-2 align-items-center justify-content-end">
|
||||
{attendanceData.activity == 2 && (
|
||||
<>
|
||||
<button
|
||||
|
||||
@ -24,7 +24,7 @@ const RenderAttendanceStatus = ({ attendanceData, handleModalData,Tab,currentDat
|
||||
|
||||
|
||||
return (
|
||||
<div className="d-flex justify-content-center">
|
||||
<div className="d-flex justify-content-end">
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-xs ${color}`}
|
||||
|
||||
@ -110,5 +110,5 @@ export const useRegularizationRequests = ( projectId ) =>
|
||||
}
|
||||
|
||||
}, [ projectId ] );
|
||||
return {regularizes,loading,error}
|
||||
return {regularizes,loading,error,refetch:fetchData}
|
||||
}
|
||||
@ -20,8 +20,6 @@ export const markAttendance = createAsyncThunk(
|
||||
'attendanceLogs/markAttendance', // Updated action type prefix
|
||||
async ( formData, thunkAPI ) =>
|
||||
{
|
||||
|
||||
|
||||
try {
|
||||
let newRecordAttendance = {
|
||||
Id: formData.id || null,
|
||||
|
||||
@ -6,7 +6,7 @@ export const markCurrentAttendance = createAsyncThunk(
|
||||
'attendanceCurrentDate/markAttendance',
|
||||
async ( formData, {getState, dispatch, rejectWithValue} ) =>
|
||||
{
|
||||
debugger
|
||||
|
||||
const { projectId } = getState().localVariables
|
||||
try
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user