Skip to content

London | 26-ITP-May | Eyob Zeray | Sprint 2 | Book Library - #502

Open
eyob-tech wants to merge 2 commits into
CodeYourFuture:mainfrom
eyob-tech:feature/book-library
Open

London | 26-ITP-May | Eyob Zeray | Sprint 2 | Book Library#502
eyob-tech wants to merge 2 commits into
CodeYourFuture:mainfrom
eyob-tech:feature/book-library

Conversation

@eyob-tech

Copy link
Copy Markdown

Changelist

Fixed the following bugs in the Book Library debugging exercise:

  1. Website loads but doesn't show any books — missing closing parenthesis in the render() for-loop was causing a syntax error that broke the whole script
  2. Error in console when adding a book — submit() was pushing to an undefined library variable instead of myLibrary
  3. Title used as author name — Book() was being called with title.value passed twice instead of author.value for the author field
  4. Delete button broken — variable was declared as delButton but referenced as delBut, and the event listener used "clicks" instead of "click"
  5. Wrong read status saved — the Yes/No display logic was inverted
  6. Missing author validation — submit() only checked title and pages for empty values; added a check for author so a book can't be added without one, matching the spec

Tested manually in the browser: books display on load, adding a book with all fields works correctly, missing fields trigger the alert, read status toggles correctly, and delete removes the correct book.

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Fixed the bugs listed in the README:

  • Website not showing books: fixed a syntax error in render() (missing closing parenthesis)
  • Console error on adding a book: fixed submit() referencing an undefined variable instead of myLibrary
  • Title used as author: fixed Book() call to use the author field instead of duplicating the title
  • Delete button broken: fixed a variable name mismatch and an incorrect event listener name
  • Wrong read status saved: fixed inverted Yes/No logic
  • Also added validation so a book can't be submitted with a missing author, per the spec

…thor field, delete button, read status logic
…thor field, delete button, read status logic, missing author validation
@eyob-tech eyob-tech added 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Submit:PR Module-Data-Flows The name of the module. labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Flows The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module Submit:PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant