Skip to content

Commit 09ec7e0

Browse files
author
Ammar Dodin
committed
🆕 convert qs array params to a comma separated string
1 parent 0de77af commit 09ec7e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/requestwrapper.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ export function createRequest(parameters, _callback) {
225225

226226
// Query params
227227
if (options.qs && Object.keys(options.qs).length > 0) {
228+
// dialog doesn't like qs params joined with a `,`
229+
if (!parameters.defaultOptions.url.match(/dialog\/api/)) {
230+
Object.keys(options.qs).forEach(
231+
key =>
232+
Array.isArray(options.qs[key]) &&
233+
(options.qs[key] = options.qs[key].join(','))
234+
);
235+
}
228236
options.useQuerystring = true;
229237
}
230238

0 commit comments

Comments
 (0)