Skip to content

backend routes

Arebiter edited this page Nov 3, 2021 · 12 revisions

Backend Routes

HTML

  • GET/ StaticPagesController#root

API Endpoints

users

  • GET /api/users - gets user information for all displayed teaTimes
  • GET /api/users/:user_id - returns information on single user
  • POST /api/users - sign up

session

  • POST /api/session - log in
  • DELETE /api/session - log out

teaTimes

  • GET /api/teaTimes - list of all teaTimes
  • GET /api/teaTimes/:teaTime_id - return single teaTime
  • POST /api/teaTimes - creates teaTime
  • PATCH /api/teaTimes/:teaTime_id - edit a teaTime
  • DELETE /api/teaTime/:teaTime_id - remove a teaTime

enrollments

  • POST /api/teaTime/:id/attend - attend a teaTime
  • POST /api/attendance/attendance_id - attend a teaTime

Reviews

  • GET /api/users/:id/reviews - shows all reviews a user had made
  • POST /api/reviews - creates a review
  • GET /api/reviews/:review_id - return single review
  • PATCH /api/reviews/:review_id - edit a review
  • DELETE /api/reviews/:review_id - remove a review

Questions

  • maybe more nested routes for the user/host - to show events they'd held previously?
    • GET /api/users/:id/history - gets a list of current and previous teatimes?
      • then I'd have to store previous teaTimes
Clone this wiki locally