Skip to content

Commit

Permalink
Merge pull request #227 from leipert/leipert-fix-array-syntax
Browse files Browse the repository at this point in the history
fix: Changing Array syntax to `'brackets'` to match Gitlab API
  • Loading branch information
jdalrymple authored Oct 29, 2018
2 parents 0e4742b + dececa6 commit d10ec1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/infrastructure/RequestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface RequestParametersInput {
json?: boolean;
body?: Object;
qs?: Object;
qsStringifyOptions? : Object;
formData?: temporaryAny;
resolveWithFullResponse?: boolean;
rejectUnauthorized?: boolean;
Expand Down Expand Up @@ -44,9 +45,10 @@ function defaultRequest(
if (qs) {
if (useXMLHttpRequest) {
// The xhr package doesn't have a way of passing in a qs object until v3
params.url = URLJoin(params.url, `?${QS.stringify(Humps.decamelizeKeys(qs))}`);
params.url = URLJoin(params.url, `?${QS.stringify(Humps.decamelizeKeys(qs), { arrayFormat: 'brackets' })}`);
} else {
params.qs = Humps.decamelizeKeys(qs);
params.qsStringifyOptions = { arrayFormat: 'brackets' };
}
}

Expand Down
4 changes: 1 addition & 3 deletions test/tests/services/ApplicationSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ describe('ApplicationSettings.all', () => {
'session_expire_delay',
'shared_runners_enabled',
'shared_runners_text',
'sidekiq_throttling_enabled',
'sidekiq_throttling_factor',
'sidekiq_throttling_queues',
'sign_in_text',
'signup_enabled',
'terminal_max_session_time',
Expand All @@ -136,6 +133,7 @@ describe('ApplicationSettings.all', () => {
'user_oauth_applications',
'version_check_enabled',
'web_ide_clientside_preview_enabled',
'diff_max_patch_bytes',
'password_authentication_enabled',
'signin_enabled',
]);
Expand Down

0 comments on commit d10ec1b

Please sign in to comment.