dmopsick / pkmnsearch

A small react project to keep my skills sharp. Turns a google search for a pokedex page on serebii into a form.
0 stars 0 forks source link

Expand link building logic to all generations #5

Open dmopsick opened 4 years ago

dmopsick commented 4 years ago

It is currently in working order, but #3 contains the information for the improvement of the link building logic assignment. Also an unforseen bug is in the serebii naming convention.

The Gen 8 Pokedex on Serebii takes in the lowercase Pokemon name or /<nationalDexNum>.shtml to reach the Pokedex page. Gen 7 and before only take the latter. My logic only contains link building based on the Pokemon name.

Originally posted by @dmopsick in https://github.com/dmopsick/pkmnsearch/issues/2#issuecomment-602758031

So as stated above. The link formation currently only works for the generation 8 Pokedex. I suppose I would have to match the names of the Pokemon with their national dex number. Woof.

dmopsick commented 4 years ago

Can potentially use this to handle the matching of Pokemon names to numbers... the pokedex number is the id field of a successful call. https://pokeapi.co/

dmopsick commented 4 years ago

This would allow for some validation - if an invalid Pokemon name is given to the api then null is returned.