Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update "Check if Users Follow Playlist" endpoint #486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions __tests__/spotify-web-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3121,7 +3121,7 @@ describe('Spotify Web API', () => {
) {
expect(method).toBe(superagent.get);
expect(uri).toBe(
'https://api.spotify.com/v1/users/spotify_germany/playlists/2nKFnGNFvHX9hG5Kv7Bm3G/followers/contains'
'https://api.spotify.com/v1/playlists/2nKFnGNFvHX9hG5Kv7Bm3G/followers/contains'
);
expect(options.query).toEqual({
ids: 'thelinmichael,ella'
Expand All @@ -3137,7 +3137,7 @@ describe('Spotify Web API', () => {
});

api
.areFollowingPlaylist('spotify_germany', '2nKFnGNFvHX9hG5Kv7Bm3G', [
.areFollowingPlaylist('2nKFnGNFvHX9hG5Kv7Bm3G', [
'thelinmichael',
'ella'
])
Expand Down
9 changes: 3 additions & 6 deletions src/spotify-web-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1340,19 +1340,16 @@ SpotifyWebApi.prototype = {

/**
* Check if users are following a playlist.
* @param {string} userId The playlist's owner's user ID
* @param {string} playlistId The playlist's ID
* @param {String[]} User IDs of the following users
* @param {String[]} followerIds IDs of the following users
* @param {requestCallback} [callback] Optional callback method to be called instead of the promise.
* @returns {Promise|undefined} A promise that if successful returns an array of booleans. If rejected,
* it contains an error object. Not returned if a callback is given.
*/
areFollowingPlaylist: function(userId, playlistId, followerIds, callback) {
areFollowingPlaylist: function(playlistId, followerIds, callback) {
return WebApiRequest.builder(this.getAccessToken())
.withPath(
'/v1/users/' +
encodeURIComponent(userId) +
'/playlists/' +
'/v1/playlists/' +
playlistId +
'/followers/contains'
)
Expand Down