Commit 9b78055a by jaymehta

paginationissue

1 parent 32ac1ea7
......@@ -93,7 +93,7 @@ const ListingInner = ({ allActivitiesData, loading, totalCount }) => {
if (activityFilters.priceUpperLimit) {
filters["priceUpperLimit"] = activityFilters.priceUpperLimit;
}
// console.log("subcategory >>", filters);
console.log("router >>", router.query.page);
dispatch(
getActivitiesByFilters({
subCategory: filters.subCategory,
......
......@@ -15,9 +15,9 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
const { endUser } = useSelector(state => state.endUser);
const router = useRouter();
const dispatch = useDispatch();
useEffect(() => {
dispatch(getActivitiesByFilters({ currentPage: router.query.page }));
}, [router]);
// useEffect(() => {
// dispatch(getActivitiesByFilters({ currentPage: router.query.page }));
// }, [router]);
console.log("endUser", endUser);
// console.log("router", router);
let { page = 1, location = "" } = router.query;
......@@ -117,7 +117,12 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
activePage={page}
itemsCountPerPage={12}
totalItemsCount={totalCount}
onChange={handlePagination}
onChange={async (e) => {
console.log(e);
await handlePagination(e);
dispatch(getActivitiesByFilters({ currentPage: e }));
}}
nextPageText={"›"}
prevPageText={"‹"}
firstPageText={"«"}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!