STEP-Pod-Capstone-Project / Capstone-Project

https://book-book-app.appspot.com
Apache License 2.0
4 stars 0 forks source link

MyReads Rendering On Unread Book #151

Closed antoniolinhart closed 4 years ago

antoniolinhart commented 4 years ago

Description

This PR ensures that the MyRead page updates when the 'unread book' button is clicked.

If the current link includes /myreads AND the deleteReadBook prop is passed, it will call that function, which will filter out the book in the state of MyBooks which matches the id of the removed book.

I originally considered just checking the /myreads link, but there are some cases where someone may name their Club or BookList "myreads" which would cause this to fail since the way we calculate links would end up like /clubs/myreads which would cause this function to fire incorrectly. For that reason, I ensure that both of them are true.