Open T04435 opened 2 months ago
Hi! Not only that, if you search for products with ?q=a, you will get 10 items on the page (all containing the letter 'a'). The reason for this is incorrect logic in the /lib/db.ts file (and some other places). The offset is set incorrectly and currently reflects the offset for future queries instead of the current one. When performing a search with no query, the offset is set to the old offset + 5, but only if the previous offset is not null and greater than 5.
I believe I have solved all the issues You have listed. If possible, could I create a PR for this? 😃
The only question I have is what should be done when searching for a product with an active search? In my fix, I show all items found and hide the bar that displays the number of items and the buttons for switching between pages.
few things:
?q=foo
the messageShowing x-y of z
breaks x is negativeHappy to update this to shadcn/ui > Pagination