Commit 2783b2a4 authored by Igor Stuev's avatar Igor Stuev Committed by isstuev

Update ui/txs/useQueryWithPages.ts

Co-authored-by: default avatartom goriunov <tom@ohhhh.me>
parent 05cb9500
......@@ -32,7 +32,7 @@ export default function useQueryWithPages(queryName: string, filter: string) {
if (page >= pageParams.length && data?.next_page_params) {
// api adds filters into next-page-params now
// later filters will be removed from response
const nextPageParams = pick(data?.next_page_params, PAGINATION_FIELDS);
const nextPageParams = pick(data.next_page_params, PAGINATION_FIELDS);
setPageParams(prev => [ ...prev, nextPageParams ]);
const nextPageQuery = { ...router.query };
Object.entries(nextPageParams).forEach(([ key, val ]) => nextPageQuery[key] = val.toString());
......
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