Closed Leenaiman98 closed 2 years ago
Please review your code, because when I click rate it raise an error with the message Required int parameter 'book_id' is not present
@AsemLab I will check it know!!
NOTE: I use random ID's because the rate button place not specified yet in the UI
@AsemLab
I just realized that I upload wrong controller. Correct one has been Uploaded
GO AHEAD!!
@Leenaiman98 Theres 2 bugs in your code:
In BookRatingPK class : customerId must be customer_id & bookId must be book_id.
In BooksRatingController the rate field accept negative and zero numbers.
Please, fix these bugs and update your code
DONE!! Thanks for good notes ...
@Leenaiman98 In BookRatingPK class : customerId must be customer_id
and check the book_ratings schema in MySql:
CREATE TABLE book_ratings( customer_id INT NOT NULL, book_id INT NOT NULL, rate INT DEFAULT 0, feedback VARCHAR(30) DEFAULT NULL, PRIMARY KEY(customer_id,book_id), FOREIGN KEY (customer_id) REFERENCES persons (person_id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (book_id) REFERENCES books (book_id) ON DELETE CASCADE ON UPDATE CASCADE );
There is no person_id column
@Leenaiman98
The rating feature is working successfully, I will close this issue.
Rating(book_id , Library_id , customer_id , rate , feedback)