Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 2 | Book-library - #516
Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 2 | Book-library#516Tobias-Amaechina wants to merge 22 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
abaaa14 to
2606f98
Compare
cjyuan
left a comment
There was a problem hiding this comment.
Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Flows/blob/general-review-feedback/debugging/book-library/feedback.md
Doing so can help me speed up the review process. Thanks.
… in index.html file
|
Thank you CY for the link , it definitely helped and the HTML has been validated , Thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
7eaaef1 to
bbef966
Compare
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
Changes look good.
I only have a few more possible improvements for you to consider.
| <input | ||
| type="number" | ||
| class="form-control" | ||
| id="pages" | ||
| name="pages" | ||
| required | ||
| /> |
There was a problem hiding this comment.
Why not make this input element to accept only positive whole number?
| value="Submit" | ||
| class="btn btn-primary" | ||
| onclick="submit();" | ||
| onclick="handleSubmit();" |
There was a problem hiding this comment.
Suggestion: Look up the trade-off among different approaches for attaching event listener to HTML elements. In particulars,
- Via HTML attribute in HTML
- In JS, using
.addEventListener()
| let book = new Book(title.value, title.value, pages.value, check.checked); | ||
| library.push(book); | ||
| render(); | ||
| if (!title || !author || !pages || pages <= 0) { |
There was a problem hiding this comment.
What type of number should pages be? Could it be NaN?
Self checklist
Changelist
Corrected validation logic to ensure title, author, and pages fields are required before adding a book.
Fixed bug where the author field was ignored and replaced with the title value.
Corrected array reference (library → myLibrary) to prevent runtime errors when adding books.
Repaired table‑rendering loop by fixing a missing parenthesis in the row‑deletion logic.
Corrected read/unread status logic so check === true displays “Yes”.
Fixed delete‑button creation:
Corrected variable name (delButton instead of delBut)
Removed accidental reassignment of the button element
Corrected event listener from "clicks" to "click"
Ensured delete action removes the correct book and re-renders the table