-
Notifications
You must be signed in to change notification settings - Fork 0
Backend Routes
chen445 edited this page May 27, 2021
·
1 revision
GET / StaticPagesController#root
-
GET /api/users- find all users. User info are used in displaying current logged in user gmail, resolving sellers' names for products, and resolving reviewers' name. -
POST /api/users- It creates a new user with gmail, password and name.
-
GET /api/products- It expects a parameter calledsearch_query. When it is empty, returns all products. Otherwise we return products that contains thesearch_query. -
GET /api/products/:id- It returns details of a product.
-
GET /api/products/:product_id/reviews- It returns all reviews for the particular product with the ID. -
POST /api/products/:product_id/reviews- It creates a review for the product withproduct_id. -
PATCH /api/products/:product_id/reviews/:id- It modifies an existing review for the product withproduct_id. -
DELETE /api/products/:product_id/reviews/:id- It deletes a review by ID.
-
GET /api/carts- It returns all cart items belongs to the current user. -
DELETE /api/carts/:id- It deletes an item in the cart. -
POST /api/carts/:id- It create a new item in the cart for a product.
-
POST /api/session- User login -
DELETE /api/session- User logout