Commit 9b78055a by jaymehta

paginationissue

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