Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Publish v0.3.0-alpha.11
Browse files Browse the repository at this point in the history
- ignore undefined and null when settings searchParams in the get request
  • Loading branch information
soerenmeier committed Mar 17, 2024
1 parent cc4e19d commit 04e4630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fire-lib-js",
"version": "0.3.0-alpha.10",
"version": "0.3.0-alpha.11",
"author": "Sören Meier <[email protected]>",
"type": "module",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export default class Api {
const searchParams = url.searchParams;

for (const [key, value] of Object.entries(data ?? {})) {
searchParams.set(key, value);
if (value !== undefined && value !== null)
searchParams.set(key, value);
}
} else {
fetchParams.body = JSON.stringify(data);
Expand Down

0 comments on commit 04e4630

Please sign in to comment.