Skip to content

API Documentation

kdng edited this page Mar 14, 2022 · 9 revisions

API Routes

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the trainer for specific features.

Catchlists

  • A logged in trainer can log into their trainer page

    • GET trainers/:trainerId/catchlist/name
  • A logged in trainer may delete pokemons off their own catchlist without causing a redirect or refresh

    • DELETE trainers/:trainerId/catchlist/name
  • A logged in trainer can update their catchlist

    • PUT trainers/:trainerId/catchlist/name

Reviews

  • Any trainer can see any reviews of every pokemon

    • GET pokemons/:pokemonId/reviews
  • A logged in trainer may delete their own reviews without causing a redirect or refresh

    • DELETE trainers/:trainerId/reviews/:reviewsId
  • A logged in trainer can edit their reviews in every pokemon

    • PUT pokemons/:pokemonId/reviews/:reviewsId
  • A logged in trainer can post a review to any pokemon

    • POST pokemons/:pokemonId/reviews

Pokemons

  • Any trainer (logged in or not logged in) can view the list of pokemons in the homepage

    • GET /pokemons
  • Any trainer can view any pokemon reviews my clicking on the specific pokemon (however, only logged in trainers can rate/write pokemon reviews)

    • GET /pokemons/:pokemonId

Clone this wiki locally