Commit f3f732e3 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Merge pull request #906 from blockscout/bugfix/pagination-params

bugfix: fix api fetch query falsy params
parents d1cb771c a16174e2
......@@ -18,8 +18,8 @@ export default function buildUrl<R extends ResourceName>(
const url = new URL(compile(path)(pathParams), baseUrl);
queryParams && Object.entries(queryParams).forEach(([ key, value ]) => {
// there are some pagination params that can be null for the next page
(value || value === null) && url.searchParams.append(key, String(value));
// there are some pagination params that can be null or false for the next page
value !== undefined && value !== '' && url.searchParams.append(key, String(value));
});
return url.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