Skip to content

Conversation

iliasbo
Copy link
Member

@iliasbo iliasbo commented Sep 17, 2026

Description

Fixes issue #29 by updating the guard condition in src/api/pokemon.ts from id < 0 to id < 1.

Changes Made

  • Updated boundary check in getPokemonByID to id < 1 || id > 1025.

Related Issue

Closes #29

@iliasbo iliasbo requested a review from a team as a code owner September 17, 2026 12:21
Copy link
Member

@ayushb ayushb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this out and ran it: tsc, eslint and the full suite pass. The guard now matches what the error message already claimed.

One thing worth adding while you're in here: the api tests cover -1 and 1025 but not 0, so nothing actually pins the new boundary. A case for id 0 would lock in the thing this PR fixes.

@ayushb ayushb merged commit 7ee0fbf into main Sep 17, 2026
ayushb added a commit that referenced this pull request Sep 17, 2026
* Add cases for id 0 and id 1, the boundary #32 moved
* Nothing covered id 0 before, so the fix it made was untested

References #29
@thomhet thomhet deleted the fix/issue-29-id-validation branch September 18, 2026 22:58
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getPokemonByID lets id 0 through
2 participants