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

bugfix: fix api fetch query falsy params
This commit is contained in:
tom goriunov
2023-06-13 10:11:48 -04:00
committed by GitHub
+2 -2
View File
@@ -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();