Commit cd057e9d by jaymehta

paginationissue

1 parent 952ec4d9
......@@ -20,7 +20,7 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
// }, [router]);
console.log("endUser", endUser);
// console.log("router", router);
let { page = 1, location = "" } = router.query;
let { page, location = "" } = router.query;
page = Number(page);
let queryParams;
......@@ -39,6 +39,8 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
} else {
queryParams.append("page", pageNumber);
}
dispatch(getActivitiesByFilters({ currentPage: e }));
router.replace({
search: queryParams.toString()
});
......@@ -120,8 +122,6 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
onChange={async (e) => {
console.log("log >",e);
await handlePagination(e);
dispatch(getActivitiesByFilters({ currentPage: e }));
}}
nextPageText={"›"}
prevPageText={"‹"}
......
......@@ -441,6 +441,8 @@ export const getActivitiesByFilters =
};
if (currentPage) {
query.pagination["page"] = Number(currentPage);
} else {
query.pagination["page"] = 1;
}
console.log("page query", query);
if (category) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!