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

Fix pagination pages being parsed as strings #32

Merged
merged 2 commits into from
May 28, 2024

Conversation

0237h
Copy link
Collaborator

@0237h 0237h commented May 28, 2024

The limit and page parameters were transformed as ZodDefault after the first query. This means the routine for identifying the underlying type would fail as it didn't fall in the ZodOptional or ZodUnion cases.

Hence, those parameters would be interpreted as strings and the + operator for the calculation of pages would be interpreted as concatenation rather than integer addition.

The `limit` and `page` parameters were transformed as `ZodDefault` after
the first query. This means the routine for identifying the underlying
type would fail as it didn't fall in the `ZodOptional` or `ZodUnion` cases.

Hence, those parameters would be interpreted as strings and the `+` operator
for the calculation of pages would be interpreted as concatenation rather
than integer addition.
@0237h 0237h self-assigned this May 28, 2024
@github-actions github-actions bot added the bug Something isn't working label May 28, 2024
@0237h 0237h merged commit fcc8b5d into main May 28, 2024
2 checks passed
@0237h 0237h deleted the fix/pagination-pages-parsed-as-strings branch May 28, 2024 15:25
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

Successfully merging this pull request may close these issues.

1 participant