Skip to content

Commit

Permalink
change addToWatchlist() request method
Browse files Browse the repository at this point in the history
The endpoint 'WATCHLISTS_ADD_PATH' only supports 'PUT' and 'DELETE'.
  • Loading branch information
GregerLindblom committed Oct 4, 2017
1 parent a3c25e4 commit b17aa4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class Avanza extends EventEmitter {
const path = constants.paths.WATCHLISTS_ADD_PATH
.replace('{0}', watchlistId)
.replace('{1}', instrumentId)
return this.call('GET', path)
return this.call('PUT', path)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test('addToWatchlist()', async (t) => {
.replace('{0}', '54321')

const actual = t.context.call.args[0]
const expected = ['GET', expectedPath]
const expected = ['PUT', expectedPath]
t.deepEqual(actual, expected)
})

Expand Down

0 comments on commit b17aa4b

Please sign in to comment.