Skip to content

Commit 8fc5b3d

Browse files
committed
good now
1 parent a91d4d9 commit 8fc5b3d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clients/algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ export function createTransporter({
116116
for (const [key, value] of Object.entries(
117117
requestOptions.queryParameters
118118
)) {
119-
if (Object.prototype.toString.call(value) === '[object Object]') {
119+
// We want to keep `undefined` and `null` values,
120+
// but also avoid stringifying `object`s, as they are
121+
// handled in the `serializeUrl` step right after.
122+
if (
123+
!value ||
124+
Object.prototype.toString.call(value) === '[object Object]'
125+
) {
120126
queryParameters[key] = value;
121127
} else {
122128
queryParameters[key] = value.toString();

0 commit comments

Comments
 (0)