mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
Merge pull request #906 from blockscout/bugfix/pagination-params
bugfix: fix api fetch query falsy params
This commit is contained in:
+2
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user