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

Passing an invalid numeric value to non-class-events GET method produces 500 #431

Open
rmainwork opened this issue Oct 28, 2021 · 0 comments
Labels
bug/broken functionality Something isn't working

Comments

@rmainwork
Copy link
Contributor

Description

Making a GET request to /api/non-class-events?acyr=2022/ (note the slash at the end) raises a 500 server error.

To Reproduce

  1. Make GET request to /api/non-class-events?acyr=2022/

Expected Behavior

A validation error should be raised (since '2022/' is not a numeric value)

Actual Behavior

A 500 error was returned

Proposed solution is to pass ParseIntPipe as the second argument to @Query().

-    @Query('acyr') acyr?: number
+    @Query('acyr', ParseIntPipe) acyr?: number
@rmainwork rmainwork added the bug/broken functionality Something isn't working label Oct 28, 2021
@jonseitz jonseitz added this to the Non-Class Meetings milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/broken functionality Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants