fix: #227 Fixing array syntax thanks to [Lukas Eipert](https://github.com/leipert)

This commit is contained in:
Justin Dalrymple 2018-10-29 10:58:34 -04:00
parent 1e5146c770
commit f9bc34dcb5
3 changed files with 383 additions and 368 deletions

747
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,7 @@
"got": "^9.2.2", "got": "^9.2.2",
"humps": "^2.0.1", "humps": "^2.0.1",
"ky": "^0.4.1", "ky": "^0.4.1",
"query-string": "^6.2.0",
"randomstring": "^1.1.5" "randomstring": "^1.1.5"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,5 +1,6 @@
import Request from 'got'; import Request from 'got';
import { decamelizeKeys } from 'humps'; import { decamelizeKeys } from 'humps';
import { stringify } from 'query-string';
interface GetPaginatedOptions { interface GetPaginatedOptions {
showPagination?: boolean; showPagination?: boolean;
@ -12,7 +13,7 @@ function defaultRequest(service, endpoint, { body, query }: { body?: Object, que
[service.url, endpoint].join('/'), [service.url, endpoint].join('/'),
{ {
headers: service.headers, headers: service.headers,
query: query && decamelizeKeys(query), query: query && stringify(decamelizeKeys(query), { arrayFormat: 'bracket' }),
body: body && decamelizeKeys(body), body: body && decamelizeKeys(body),
rejectUnauthorized: service.rejectUnauthorized, rejectUnauthorized: service.rejectUnauthorized,
json: true, json: true,