LAMaglan / PokeFightSimulator

A (simple) fight simulator between any two Pokemon using FastAPI with Jinja frontend
0 stars 0 forks source link

Get all pokemon #26

Closed LAMaglan closed 3 months ago

LAMaglan commented 3 months ago

Address https://github.com/LAMaglan/PokeFightSimulator/issues/24, i.e. autocomplete input pokemon name fields

First commit https://github.com/LAMaglan/PokeFightSimulator/commit/1ff7476536767e0451bd015eb294191ac119dc04 fetches all pokemon names (from pokeapi) on startup of FastAPI app, and makes it available globally.

Second commit https://github.com/LAMaglan/PokeFightSimulator/commit/d6ce0dab76633ca55585581e66f74a5dca43a04e creates new endpoint that turns it to JSON which can then be passed to client side (in this case, index.html). The form fields are now lists and made to "datalist" which can be populated. Specifically, the datalists are populated with javascript code.