Fiixedd: Regularization pagination not reflecting current page data
This commit is contained in:
parent
c704982f3c
commit
a65243f45d
@ -8,6 +8,7 @@ import moment from "moment";
|
|||||||
import usePagination from "../../hooks/usePagination";
|
import usePagination from "../../hooks/usePagination";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import { cacheData, clearCacheKey } from "../../slices/apiDataManager";
|
import { cacheData, clearCacheKey } from "../../slices/apiDataManager";
|
||||||
|
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
||||||
|
|
||||||
const Regularization = ({ handleRequest }) => {
|
const Regularization = ({ handleRequest }) => {
|
||||||
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||||
@ -44,7 +45,7 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
|
|
||||||
const { currentPage, totalPages, currentItems, paginate } = usePagination(
|
const { currentPage, totalPages, currentItems, paginate } = usePagination(
|
||||||
filteredData,
|
filteredData,
|
||||||
20
|
ITEMS_PER_PAGE
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
eventBus.on("regularization", handler);
|
eventBus.on("regularization", handler);
|
||||||
@ -85,15 +86,10 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{/* {loading && (
|
|
||||||
<td colSpan={6} className="text-center py-5">
|
|
||||||
Loading...
|
|
||||||
</td>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{!loading &&
|
{!loading &&
|
||||||
(regularizes?.length > 0 ? (
|
(currentItems?.length > 0 ? (
|
||||||
regularizes?.map((att, index) => (
|
currentItems?.map((att, index) => (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td colSpan={2}>
|
<td colSpan={2}>
|
||||||
<div className="d-flex justify-content-start align-items-center">
|
<div className="d-flex justify-content-start align-items-center">
|
||||||
@ -118,7 +114,6 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
: "--"}
|
: "--"}
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center ">
|
<td className="text-center ">
|
||||||
{/* <div className='d-flex justify-content-center align-items-center gap-3'> */}
|
|
||||||
<RegularizationActions
|
<RegularizationActions
|
||||||
attendanceData={att}
|
attendanceData={att}
|
||||||
handleRequest={handleRequest}
|
handleRequest={handleRequest}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user