Closed stephencastaneda closed 4 years ago
As a user, when the song page loads, I should be able to add songs to the list
WHEN looking at the songs page THEN I should see a button to add songs AND when I click on that button AND a form pops up for me to add songs to list
Songs.js
onClick
songTitle
artist
musicEra
albumPhoto
saveSong
this.state
newSong
postSong
songsData
.then
getAllSongs
this.props
.catch
console.error
titleChange
this.setState
e.target.value
User Story
As a user, when the song page loads, I should be able to add songs to the list
AC
WHEN looking at the songs page THEN I should see a button to add songs AND when I click on that button AND a form pops up for me to add songs to list
Dev Notes
Songs.js
to add a songonClick
that opens up a modalsongTitle
artist
musicEra
albumPhoto
saveSong
functionsongTitle
artist
musicEra
albumPhoto
fromthis.state
newSong
should build an object with the keys from abovepostSong
fromsongsData
and pass innewSong
.then
should callgetAllSongs
fromthis.props
.catch
shouldconsole.error
unable to save songstitleChange
function and a function for each inputthis.setState
toe.target.value