Skip to content

Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Book Library#450

Open
mahmoudshaabo1984 wants to merge 1 commit intoCodeYourFuture:mainfrom
mahmoudshaabo1984:book-library-mahmoud
Open

Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Book Library#450
mahmoudshaabo1984 wants to merge 1 commit intoCodeYourFuture:mainfrom
mahmoudshaabo1984:book-library-mahmoud

Conversation

@mahmoudshaabo1984
Copy link
Copy Markdown

What bugs did I fix?

  • Bug 1 - Website loads but doesn't show any books
    The for loop in the render function was missing a closing parenthesis ) before the {. This caused a syntax error that stopped all JavaScript from running.

  • Bug 2 - Error in console when you try to add a book
    The submit function was calling library.push(book) but the array is named myLibrary. Fixed by using the correct variable name. Also added validation for the author field.

  • Bug 3 - It uses the title name as the author name
    In the submit function, title.value was used twice. The second argument should be author.value.

  • Bug 4 - Delete button is broken
    The delete button variable was created as delButton but then referenced as delBut three times. Also the event name was "clicks" instead of "click". Fixed both issues.

  • Bug 5 - Read status saves the wrong answer
    The if condition was inverted. check == false was showing "Yes". Fixed so check == true correctly shows "Yes".

How to test

  1. Open index.html in the browser
  2. Two books appear on load — both show "Yes" in the Read column
  3. Click "Add new book" and fill in the form — the new book appears in the table
  4. Click the "Yes"/"No" button on any book — it toggles correctly
  5. Click "Delete" on any book — the book is removed from the table
  6. Try submitting the form with empty fields — an alert appears

Hi @cifarquhar — I have fixed all 5 bugs listed in the readme. Please let me know if you have any feedback. Thank you!

@github-actions

This comment has been minimized.

@mahmoudshaabo1984
Copy link
Copy Markdown
Author

Hi @cifarquhar — PR #450 is ready for review.

I have fixed all 5 bugs listed in the readme.md file. The app now loads correctly, books can be added and deleted, and the read status toggles as expected.

Please let me know if anything needs to be changed. Thank you!

@mahmoudshaabo1984 mahmoudshaabo1984 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@mahmoudshaabo1984 mahmoudshaabo1984 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@mahmoudshaabo1984 mahmoudshaabo1984 changed the title Sheffield Jan 2026 | Book Library | Mahmoud Shaabo Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Book Library Apr 16, 2026
@mahmoudshaabo1984 mahmoudshaabo1984 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant