Skip to content

Commit

Permalink
Merge pull request #906 from blockscout/bugfix/pagination-params
Browse files Browse the repository at this point in the history
bugfix: fix api fetch query falsy params
  • Loading branch information
tom2drum authored Jun 13, 2023
2 parents d1cb771 + a16174e commit f3f732e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/api/buildUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f3f732e

Please sign in to comment.