From 345be979f3c98c3ca3657b794cc9309545f1c3ba Mon Sep 17 00:00:00 2001 From: Connor Lindsey Date: Tue, 7 May 2024 13:18:32 -0700 Subject: [PATCH] fix: filter undefined values when creating the query url (#71) * fix: filter undefined values when creating the query url * fix: early return --- src/common/fetchClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/fetchClient.ts b/src/common/fetchClient.ts index d340b97..1d9a26b 100644 --- a/src/common/fetchClient.ts +++ b/src/common/fetchClient.ts @@ -97,6 +97,9 @@ export default class FetchClient { function appendParams(key: string, value: any, parentKey?: string) { const fullKey = parentKey ? `${parentKey}[${key}]` : key; + // Skip undefined values + if (value === undefined) return; + if ( typeof value === "object" && value !== null &&