Shopmost icon indicating copy to clipboard operation
Shopmost copied to clipboard

[BUG] LIMIT must not be negative

Open kkumarcodes opened this issue 9 months ago • 0 comments

Describe the bug

The filter that is situated on almost all the views in the Admin Panel does pop a blank page with the following error : LIMIT must not be negative, if you put a negative value, it's a small bug but still we need to catch every exception.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Admin Panel'
  2. Click on 'Categories or Products'
  3. Change the value in Show per page with a negative value '-1 for example'
  4. It should display : LIMIT must not be negative

Expected behavior

Normally when putting a negative value it should at least indicate with an alert that the value is not correct or just do nothing, but in this case it pops out on a blank page with the error below.

Background (please complete the following information):

NodeJS v16 Postgres v15 EverShop v1.0.0-rc.8 OS: Linux Ubuntu Focal Browser: Chrome

Solution

I have found a workaround by modifying the Pagination JSX with the following snippet on the onKeyPressLimit function :

const onKeyPressLimit = (e) => { .... if (limitNumber <= 0) { limitNumber = 1; } .... }; It works fine

kkumarcodes avatar Nov 03 '23 03:11 kkumarcodes