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