src/redux/reducers/playlists.js
//Get new playlist returned by server and return existing playlists PLUS the new one we just made
Get new playlist returned by server and return existing playlists PLUS the new one we just made
Get new playlist returned by server and return existing playlists PLUS the new one we just made
function playlists_CreatePlaylistSuccess(state, action) {
  state.data.items.unshift(action.playlist);
  console.log("Successfully created playlist");
  return {
    ...state,
    loading: false,
    error: null,
  };
}
function playlists_CreatePlaylistSuccess ( state , action ) { state . data . items . unshift ( action . playlist ) ; console . log ( "Successfully created playlist" ) ; return { ... state , loading : false , error : null , } ; }
Get new playlist returned by server and return existing playlists PLUS the new one we just made
Get new playlist returned by server and return existing playlists PLUS the new one we just made
//Add new playlist to our array