fix(httpclient): pass query params as object for smartrequest compatibility

This commit is contained in:
Juergen Kunz
2025-07-25 11:27:55 +00:00
parent 1190500221
commit 16135cae02
3 changed files with 11 additions and 4 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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 {