-
-
Notifications
You must be signed in to change notification settings - Fork 160
London | 25-ITP-Sep |Mariia Serhiienko | Sprint 2 | Book Library Project #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jennethydyrova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work @Konvaly!
debugging/book-library/script.js
Outdated
| const titleValue = title.value.trim(); | ||
| const authorValue = author.value.trim(); | ||
| const pagesValue = pages.value.trim(); | ||
| const pagesNumber = Number(pagesValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add "value" to every variable because they usually hold values. Also, L30 and 31 can be merged.
debugging/book-library/script.js
Outdated
| return; | ||
| } | ||
|
|
||
| let book = new Book(titleValue, authorValue, pagesNumber, check.checked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it declared with let?
debugging/book-library/script.js
Outdated
| authorCell.textContent = book.author; | ||
| pagesCell.textContent = book.pages; | ||
|
|
||
| const changeBut = document.createElement("button"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing you need to change but better name would be changeBtn, this is just a convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed changeBut to changeBtn and delBut to delBtn
|
Thank you for your time and consideration @jennethydyrova ! |
|
Looks good to me! |
Learners, PR Template
Self checklist
Changelist
PR: Fix bugs and improve adding books
What was done:
Fixed errors that stopped books from showing on page load
Fixed issues when adding a new book
Corrected author and read status values
Fixed the delete button
Cleared the form after a book is added
Prevented adding the same book twice
Result: the app now works as expected and is easier to use when adding books.