Skip to content

Commit

Permalink
Merge pull request #11 from loverajoel/joel_bugs
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
loverajoel committed Oct 5, 2015
2 parents 8df03ce + 5544c2e commit 19eb8b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/handlers/ArtistHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class ArtistHandler {
*
* @public
* @param {string} id Artist id to retrive top tracks
* @param {string} country country iso
* @param {object} query Optional query parameters. * country is required
* @return {Collection} tracksCollection
*/
topTracks(id, country) {
return Client.instance.request(`/artists/${id}/top-tracks`, 'GET', {country:country});
topTracks(id, query) {
return Client.instance.request(`/artists/${id}/top-tracks`, 'GET', query);
}

/*
Expand All @@ -75,7 +75,7 @@ class ArtistHandler {
* @param {string} id Artist id to retrive related artists
* @return {Collection} albumsCollection
*/
relatedArtists(id) {
relatedArtists(id, query) {
return Client.instance.request(`/artists/${id}/related-artists`, 'GET', query);
}

Expand Down
10 changes: 6 additions & 4 deletions src/helpers/Artist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ class Artist extends ArtistEntity {

/*
* @public
* @param {object} query Optional query parameters.
* @return {Collection} tracksCollection
*/
topTracks(country) {
return new ArtistHandler().topTracks(this.id, country);
topTracks(query) {
return new ArtistHandler().topTracks(this.id, query);
}

/*
* @public
* @param {object} query Optional query parameters.
* @return {Collection} artistsCollection
*/
relatedArtists(country) {
return new ArtistHandler().relatedArtists(this.id);
relatedArtists(query) {
return new ArtistHandler().relatedArtists(this.id, query);
}

/*
Expand Down

0 comments on commit 19eb8b4

Please sign in to comment.