Skip to content

Commit

Permalink
fix coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chregu authored and mweibel committed Sep 28, 2017
1 parent 5aac8a5 commit 100659e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/apis/stacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ export default (state) => {
*/
stacks.create = (organization, name, operations, options = null, overwrite = false) => {
operations = Array.isArray(operations) ? operations : [operations]
var queryParams = []
const queryParams = {}

if (overwrite) {
queryParams['overwrite'] = 'true'
queryParams.overwrite = 'true'
}

return state.request('PUT', `stacks/${organization}/${name}`, {operations, options}, queryParams)
}

Expand Down
4 changes: 2 additions & 2 deletions test/apis/stacks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('stacks.create', t => {
method: 'PUT',
uri: 'https://api.rokka.io/stacks/myorg/mystack',
body: {operations, options},
qs: []
qs: {}
}

td.verify(requestStub(td.matchers.contains(expectedArgs), td.matchers.anything()))
Expand All @@ -70,7 +70,7 @@ test('stacks.createOverwrite', t => {
method: 'PUT',
uri: 'https://api.rokka.io/stacks/myorg/mystack',
body: {operations, options},
qs: {'overwrite': 'true'}
qs: {overwrite: 'true'}
}

td.verify(requestStub(td.matchers.contains(expectedArgs), td.matchers.anything()))
Expand Down

0 comments on commit 100659e

Please sign in to comment.