Closed stephencastaneda closed 4 years ago
As a user, when I'm on a singleSong page I should be able to delete a resource.
WHEN I go to the singleSong page THEN I hover over a resource AND I click on the resource delete button AND the resource should be deleted
*in singleSong.js component add a delete button
singleSong.js
onClick
removeResource
this.state
deleteResource
resourceData.js
resourceId
.then
this.props.history.push
singleSong
.catch
User Story
As a user, when I'm on a singleSong page I should be able to delete a resource.
AC
WHEN I go to the singleSong page THEN I hover over a resource AND I click on the resource delete button AND the resource should be deleted
Dev Notes
*in
singleSong.js
component add a delete buttononClick
call theremoveResource
functionremoveResource
should get the { resourceId } fromthis.state
deleteResource
should get called fromresourceData.js
and pass inresourceId
.then
should usethis.props.history.push
to go back tosingleSong
.catch
should console unable to delete resource