Creation and deletion of playlists

This commit is contained in:
James Barnsley
2016-11-14 11:20:02 +13:00
parent 57311f1b6a
commit 1de58afa44
12 changed files with 338 additions and 86 deletions

View File

@ -503,6 +503,16 @@ export function getSearchResults( query, type = 'album,artist,playlist,track', l
* Playlists
**/
export function createPlaylist( name, is_private ){
return (dispatch, getState) => {
sendRequest( dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/', 'POST', { name: name, public: !is_private } )
.then( response => {
dispatch( getAllLibraryPlaylists() );
})
}
}
export function getPlaylist( uri ){
return (dispatch, getState) => {