-
Notifications
You must be signed in to change notification settings - Fork 0
Backend Routes
dsuh93 edited this page Feb 19, 2021
·
6 revisions
#Backend Routes
-
GET/
StaticPagesController#root
-
GET/api/users/:id
: returns user profile information and profile picture -
GET/api/users/:id/checkins/:drink_id
: returns all drinks user has checkedin for -
GET/api/users/:id/checkins
: returns all checkins for user profile -
POST/api/users
: sign up
-
POST/api/session
: log-in -
DELETE/api/session
: logout
-
GET/api/drinks
: returns a list of drinks for the drinks index -
GET/api/drinks/:id
: returns the show page for a specific drink, data includes name, brewery_id, type, average ratings, description, total ratings, avg ratings, total checkins, and number of checkins by current user -
POST/api/drinks
: create a drink -
PATCH/api/drinks/:id
: edit and update a drink -
DELETE/api/drinks/:id
: delete a drink -
GET/api/drinks/:id/checkins
: returns index of all checkins for drink show page (nested)
-
GET/api/breweries
: returns a list of breweries for the search bar -
GET/api/breweries/:id
: returns a show page for a specific brewery, data includes name, logo, location, average ratings, total beers -
POST/api/breweries
: create a brewery -
PATCH/api/breweries/:id
: edit a brewery -
DELETE/api/breweries/:id
: delete a brewery -
GET/api/breweries/:id/checkins
: returns index of all checkins for brewery show page (nested) -
GET/api/breweries/:id/drinks
: returns all drinks for brewery show page (nested)
-
GET/api/checkins
: returns relevant checkins (filtered bycreated_at
), includes toasts and comments -
GET/api/checkins/:id
: returns a information for a checkin show page, including number of toasts and comments -
POST/api/checkins
: create a checkin -
DELETE/api/checkins/:id
: delete a checkin
-
POST/api/comments
: create a comment -
PATCH/api/comments/:id
: edit a comment -
DELETE/api/comments:id
: delete a comment
-
POST/api/toasts
: toast a checkin -
DELETE/api/toasts/:id
: untoast a checkin
note: comments and toasts don't include a GET
route because these routes render the api/checkins/show.json.jbuilder
view