London | May 2025 | Sisay Mehari | Sprint 2 | Book Library Debugging #241
London | May 2025 | Sisay Mehari | Sprint 2 | Book Library Debugging #241sisaymehari wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
…rect 'myLibrary' in submit() to ensure new books are added properly.
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work on debugging the problems. Remember the readme says there are other bugs than the ones mentioned. I've left some pointers for where you might find them
debugging/book-library/script.js
Outdated
| wasReadCell.appendChild(changeBut); | ||
| let readStatus = ""; | ||
| if (myLibrary[i].check == false) { | ||
| if (myLibrary[i].check == true) { |
There was a problem hiding this comment.
if .check is a boolean, do you need to compare it to == true?
There was a problem hiding this comment.
We do not need to compare it.
| @@ -37,8 +37,8 @@ function submit() { | |||
| alert("Please fill all fields!"); | |||
There was a problem hiding this comment.
Is there any input validation missing from the pages? What about the author?
There was a problem hiding this comment.
I have done all the input validation.
debugging/book-library/script.js
Outdated
| delButton.className = "btn btn-warning"; | ||
| delButton.innerHTML = "Delete"; | ||
| delButton.addEventListener("click", function () { | ||
| alert(`You've deleted title: ${myLibrary[i].title}`); |
There was a problem hiding this comment.
can you think of a better user interaction than alert() here? Deleting something can be pretty bad, and being notified after a delete has happened isnt usually what you see.
There was a problem hiding this comment.
I have added a warning to notify before deleting it.
|
Great work on this -you are done with this task now |
Learners, PR Template
Self checklist
Changelist
✅ What I’ve Done
This pull request addresses multiple bugs in the Book Library project:
🔧 Bug Fixes
Books not showing on load
render()afterpopulateStorage()to ensure books display correctly when the page loads.Error in console when adding a book
library.push(...)with the correctmyLibrary.push(...)in thesubmit()function.Title used instead of author
Book()constructor arguments to passauthor.valueinstead of mistakenly usingtitle.valuetwice.No question at the moment.