Skip to content

backend routes

Vincent Shuali edited this page Feb 1, 2023 · 6 revisions

HTML

  • GET / - StaticPagesController#root

API Endpoints

session

  • POST /api/session - login
  • GET /api/session - Get current user if someone is logged in
  • DELETE /api/session - logout

member

  • POST /api/member/ - sign up
  • GET /api/member/<int: member_id> - get user's information
  • PATCH /api/member/<int: member_id> - update user's information

restaurant

  • POST /api/restaurants/ - create restaurant
  • GET /api/restaurants/<int: restaurant_id> - get restaurant's information
  • PATCH /api/restaurants/<int: restaurant_id> - update restaurant's information
  • GET /api/restaurants/ - list all restaurants (deprecate once too many restaurants are around)
  • GET /api/restaurants/search - query for specific restaurants

club

  • POST /api/club/ - create club
  • GET /api/club/<int: club_id> - get club's information (including members) (careful about N+1 query)
  • PATCH /api/club/<int: club_id> - update club's information
  • GET /api/club/search - query for specific clubs

lunch

  • POST /api/lunch/ - create lunch
  • GET /api/lunch/<int: lunch_id> - get specific lunch information
  • PATCH /api/lunch/<int: lunch_id> - update specific lunch
  • DELETE /api/lunch/<int: lunch_id> - delete specific lunch
  • GET /api/lunch/club/<int: club_id> - get lunches for specific club

poll_options

  • POST /api/poll_options/ - create poll option
  • PATCH /api/poll_options/<int: poll_option_id> - edit poll option
  • DELETE /api/poll_options/<int: poll_option_id> - delete poll option
  • GET /api/poll_options/lunch/<int: lunch_id> - view all poll options for a lunch

votes

  • POST /api/votes/ - create a vote
  • GET /api/votes/<int: vote_id> - get info for specific vote, say person wants to view what they voted for
  • PATCH /api/votes/<int: vote_id> - edit vote
  • DELETE /api/votes/<int: vote_id> - delete vote, say user wants to retract vote
  • GET /api/votes/poll_option/<int: poll_option_id> - view votes for specific poll option
  • GET /api/votes/lunch/<int: lunch_id> - view votes for a specific lunch grouped by poll option. (could also have get votes per member)
Clone this wiki locally