componentDidMount() {
        const { handle } = this.props.match.params

        spotifyApi.getPlaylist(`${handle}`)
        .then((response) => {
            const tracklist = response.tracks.items.map(
                obj => ({
                    trackname: obj.track.name,
                    artist: obj.track.artists[0].name,
                    album: obj.track.album.name,
                    duration: this.getTime(obj.track.duration_ms)
                })
            )
            
            this.setState({
                tracklist,
                playlistname: {
                    name: response.name
                }
            })
        })
        
    }
/*  Get playlist API 
        Getting the data using userplaylist. Getting the API results to object valvues and updating 
        the list array with the object values.
        Through the handle the playlist ID is passed to retrieve data. Playlist ID is retrieved in the list in playlist.js
        */
Get playlist API
Getting the data using userplaylist. Getting the API results to object valvues and updating
the list array with the object values.
Through the handle the playlist ID is passed to retrieve data. Playlist ID is retrieved in the list in playlist.js
Get playlist API Getting the data using userplaylist . Getting the API results to object valvues and updating the list array with the object values . Through the handle the playlist ID is passed to retrieve data . Playlist ID is retrieved in the list in playlist . js
componentDidMount() {
        const { handle } = this.props.match.params
        spotifyApi.getPlaylist(`${handle}`)
        .then((response) => {
            const tracklist = response.tracks.items.map(
                obj => ({
                    trackname: obj.track.name,
                    artist: obj.track.artists[0].name,
                    album: obj.track.album.name,
                    duration: this.getTime(obj.track.duration_ms)
                })
            )
            this.setState({
                tracklist,
                playlistname: {
                    name: response.name
                }
            })
        })
    }
componentDidMount ( ) { const { handle } = this . props . match . params spotifyApi . getPlaylist ( ` ${ handle } ` ) . then ( ( response ) => { const tracklist = response . tracks . items . map ( obj => ( { trackname : obj . track . name , artist : obj . track . artists [ 0 ] . name , album : obj . track . album . name , duration : this . getTime ( obj . track . duration_ms ) } ) ) this . setState ( { tracklist , playlistname : { name : response . name } } ) } ) }
Get playlist API
Getting the data using userplaylist.
Get playlist API Getting the data using userplaylist .