Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] LIMIT must not be negative #70

Open
kkumarcodes opened this issue Nov 3, 2023 · 0 comments
Open

[BUG] LIMIT must not be negative #70

kkumarcodes opened this issue Nov 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kkumarcodes
Copy link
Owner

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 kkumarcodes added the bug Something isn't working label Nov 3, 2023
@kkumarcodes kkumarcodes self-assigned this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant