The delete functionality did not work correctly when multiple bookshelves had the same name. The deletion process has been updated to use the unique ID of the bookshelf instead of the name. Below are the detailed changes made:
Changes
BookshelfService.java
Updated the deleteBookshelf method to accept an ID and delete the bookshelf based on this ID.
BookshelfController.java
Updated the deleteBookshelf endpoint to parse the ID from the request and call the service method with this ID.
homepage.html
Ensured that each bookshelf item contains a hidden element for the bookshelf ID.
bookshelf.js
Updated the event listener to correctly select the ID element within the DOM.
Issue
The delete functionality did not work correctly when multiple bookshelves had the same name. The deletion process has been updated to use the unique ID of the bookshelf instead of the name. Below are the detailed changes made:
Changes
BookshelfService.java
Updated the
deleteBookshelf
method to accept an ID and delete the bookshelf based on this ID.BookshelfController.java
Updated the
deleteBookshelf
endpoint to parse the ID from the request and call the service method with this ID.homepage.html
Ensured that each bookshelf item contains a hidden element for the bookshelf ID.
bookshelf.js
Updated the event listener to correctly select the ID element within the DOM.