Deleting all books from secondary pages will show "You don’t have any books yet"
When a user has more than 10 books in the system, pagination is implemented to display the books. Each page can contain a maximum of 10 books, and any additional books are added to subsequent pages. However, when a user deletes all the books on a secondary page (e.g., second, third, etc.), the pagination navigation does not behave as expected.
Expected behavior
After deleting all the books on the second page, I expect to be redirected to the first page of books.
Current behavior
After deleting all the books on the second page, instead of being redirected to the first page, I see this message on the dashboard: "There are no more books." as in the screenshot below. The pagination elements are not there, and I have to refresh the page in order to see the books that are in the first page.
Steps to reproduce
- Have 11 books in the dashboard.
- Go to the second page and delete the 11th one.
- Notice that after deleting the book from Step 2, you see "There are no more books." and there is no pagination for you to go to the first page.
- Reload the site and check that all the other 10 remaining books are shown in the dashboard.
Environment
Chromium, Brave, Mozilla Firefox
Possible solution
[Not required. Suggest a fix for the bug]