diff --git a/changelog.md b/changelog.md index c594a07..295ba3a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-07-25 - 4.1.1 - fix(httpclient) +Fix query parameter handling for smartrequest compatibility + +- Changed query parameter handling to pass objects directly instead of URLSearchParams +- Removed URLSearchParams usage and string conversion +- Now passes queryParams as an object to smartrequest which handles URL encoding internally + ## 2025-07-25 - 4.1.0 - feat(transactions) Enhanced transaction pagination support with full control over historical data retrieval diff --git a/package.json b/package.json index 25e3a4d..5b52bd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apiclient.xyz/bunq", - "version": "4.1.0", + "version": "4.1.1", "private": false, "description": "A full-featured TypeScript/JavaScript client for the bunq API", "type": "module", diff --git a/ts/bunq.classes.httpclient.ts b/ts/bunq.classes.httpclient.ts index 8326163..14feeb9 100644 --- a/ts/bunq.classes.httpclient.ts +++ b/ts/bunq.classes.httpclient.ts @@ -53,13 +53,13 @@ export class BunqHttpClient { }; if (options.params) { - const params = new URLSearchParams(); + const queryParams: { [key: string]: string } = {}; Object.entries(options.params).forEach(([key, value]) => { if (value !== undefined && value !== null) { - params.append(key, String(value)); + queryParams[key] = String(value); } }); - requestOptions.queryParams = params.toString(); + requestOptions.queryParams = queryParams; } try {