Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit efc94f23
authored
2024-06-06 12:46:39 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
paginationissue
1 parent
f7244728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
pages/listing.js
pages/listing.js
View file @
efc94f2
...
@@ -11,9 +11,9 @@ export default function ListingPage() {
...
@@ -11,9 +11,9 @@ export default function ListingPage() {
/** Client side rendering, traditional API call. */
/** Client side rendering, traditional API call. */
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 }));
},
[]);
//
}, []);
return
(
return
(
<
Layout
>
<
Layout
>
...
@@ -25,7 +25,7 @@ export default function ListingPage() {
...
@@ -25,7 +25,7 @@ export default function ListingPage() {
/** For server side rendering */
/** For server side rendering */
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
store
=>
async
({
req
,
query
})
=>
{
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
store
=>
async
({
req
,
query
})
=>
{
try
{
try
{
//
await store.dispatch(getActivitiesByFilters({ currentPage: query.page }));
await
store
.
dispatch
(
getActivitiesByFilters
({
currentPage
:
query
.
page
}));
await
store
.
dispatch
(
getAllCategories
());
await
store
.
dispatch
(
getAllCategories
());
await
store
.
dispatch
(
getSubCategoriesByCategoryId
());
await
store
.
dispatch
(
getSubCategoriesByCategoryId
());
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment