Skip to content

API Documentation

a-loeffler edited this page Apr 30, 2021 · 3 revisions

API Documentation

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 user for specific features.

QUESTIONS

  • A logged-in user may delete one of their own Questions, removing it from the list of visible Questions without causing a refresh/redirect.

    • DELETE /api/questions/:id
  • A logged-in user may edit one of their own Questions, changing its content without causing a refresh/redirect.

    • DELETE /api/questions/:id

RESPONSES

  • A logged-in user may delete one of their own Responses, removing it from the list of visible Responses for a specific Question without causing a refresh/redirect.

    • DELETE /api/responses/:id
  • A logged-in user may edit one of their own Responses, changing its content without causing a refresh/redirect.

    • PATCH /api/responses/:id

VOTES

  • A logged-in user may vote on a Question, updating its score without causing a refresh/redirect.

    • POST /api/questions/:id
  • A logged-in user may delete their previous vote on a Question, updating its score without causing a refresh/redirect.

    • DELETE /api/questions/:id
  • A logged-in user may vote on a Response, updating its score without causing a refresh/redirect.

    • POST /api/responses/:id
  • A logged-in user may delete their previous vote on a Response, updating its score without causing a refresh/redirect.

    • DELETE /api/responses/:id
Clone this wiki locally