diff --git a/src/apis/FollowApi.spec.ts b/src/apis/FollowApi.spec.ts index fabd14e..afdd2f8 100644 --- a/src/apis/FollowApi.spec.ts +++ b/src/apis/FollowApi.spec.ts @@ -306,6 +306,23 @@ describe('FollowApi', () => { }); }); + describe('unfollowUser', () => { + it('should unfollow a user', async () => { + const { httpMock, follow } = setup(); + + await follow.unfollowUser('foo'); + + expect(httpMock.delete).toBeCalledWith('/me/following', { + params: { + type: 'user', + }, + data: { + ids: ['foo'], + }, + }); + }); + }); + describe('unfollowUsers', () => { it('should unfollow users', async () => { const { httpMock, follow } = setup(); diff --git a/src/apis/FollowApi.ts b/src/apis/FollowApi.ts index 181d1fb..a51a6e6 100644 --- a/src/apis/FollowApi.ts +++ b/src/apis/FollowApi.ts @@ -245,6 +245,17 @@ export class FollowApi { return this.http.delete(`/playlists/${playlistId}/followers`); } + /** + * Unfollow User + * + * Remove the current user as a follower of a Spotify user. + * + * @param userId The Spotify ID of the user. + */ + unfollowUser(userId: string): Promise { + return this.unfollowUsers([userId]); + } + /** * Unfollow Users *