Commit d6a6eab3 authored by tom's avatar tom

fix pagination params in URL when going back to previous pages

parent ce1c5c41
...@@ -96,8 +96,7 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({ ...@@ -96,8 +96,7 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({
nextPageQuery = omit(router.query, [ 'next_page_params', 'page' ]); nextPageQuery = omit(router.query, [ 'next_page_params', 'page' ]);
canGoBackwards.current = true; canGoBackwards.current = true;
} else { } else {
const nextPageParams = pageParams[page - 1]; nextPageQuery.next_page_params = encodeURIComponent(JSON.stringify(pageParams[page - 1]));
nextPageParams && Object.entries(nextPageParams).forEach(([ key, val ]) => nextPageQuery[key] = String(val));
nextPageQuery.page = String(page - 1); nextPageQuery.page = String(page - 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment