Skip to content

Conversation

@sisaymehari
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

✅ What I’ve Done

This pull request addresses multiple bugs in the Book Library project:

🔧 Bug Fixes

  1. Books not showing on load

    • Called render() after populateStorage() to ensure books display correctly when the page loads.
  2. Error in console when adding a book

    • Replaced incorrect library.push(...) with the correct myLibrary.push(...) in the submit() function.
  3. Title used instead of author

    • Corrected the Book() constructor arguments to pass author.value instead of mistakenly using title.value twice.

No question at the moment.

…rect 'myLibrary' in submit() to ensure new books are added properly.
@sisaymehari sisaymehari added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Data Flows labels Jul 25, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

wasReadCell.appendChild(changeBut);
let readStatus = "";
if (myLibrary[i].check == false) {
if (myLibrary[i].check == true) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if .check is a boolean, do you need to compare it to == true?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need to compare it.

pages.value == null ||
pages.value == ""
) {
alert("Please fill all fields!");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any input validation missing from the pages? What about the author?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done all the input validation.

delButton.className = "btn btn-warning";
delButton.innerHTML = "Delete";
delButton.addEventListener("click", function () {
alert(`You've deleted title: ${myLibrary[i].title}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a warning to notify before deleting it.

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 28, 2025
@sisaymehari sisaymehari added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 28, 2025
@LonMcGregor
Copy link

Great work on this -you are done with this task now

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants