As a user, I should be able to go to a comment that I have made and delete that comment from the web application.
AC
WHEN a user navigates to a comment that they have made
THEN they should be able to delete their comment from the web application
AND the comment will be delete from firebase.
DevNotes
First, go to commentsData.js and create a deleteComment axios function call. It will look like this:
Next, pass the function through the SingleHoleCard component by adding it to the end of this line: <SingleHoleCard key={comment.id} comment={comment} deleteAComment={this.deleteAComment} />
Now, in SingleHoleCard start a new function called deleteACommentEvent.
In this function, call the deleteAComment function along with the commentId. Like this:
UserStory
AC
WHEN a user navigates to a comment that they have made THEN they should be able to delete their comment from the web application AND the comment will be delete from firebase.
DevNotes
commentsData.js
and create a deleteComment axios function call. It will look like this:deleteComment
function at the end of the file.deleteAComment
.DeleteAComment
will make a firebase axios call with the delete function we created above. The outline will be this:SingleHoleCard
component by adding it to the end of this line:<SingleHoleCard key={comment.id} comment={comment} deleteAComment={this.deleteAComment} />
SingleHoleCard
start a new function calleddeleteACommentEvent
.deleteAComment
function along with the commentId. Like this:SingleHoleCard
class, add an onClick event that will call the delete event: