You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Ability to create, read, update, and delete products, categories and subcategori
10
10
<br></br>
11
11
Fetching a product fetches the details of categories and subcategories it belongs to. Provides the ability to search for products by name, category and subcategories.
12
12
<br></br>
13
-
Paginates result when products are fetched by categoriesor subcategories.
13
+
Paginates result using cursor based pagination when products are fetched by categories, subcategories or themselves.
14
14
15
15
Deployed as a vercel function with Postgres: [ecommerce-rest-api-five.vercel.app](https://ecommerce-rest-api-five.vercel.app)
16
16
<br> Documented with Swagger UI.
@@ -64,9 +64,10 @@ Test the API using Swagger UI (`/` route), Postman, cURL or your preferred HTTP
64
64
65
65
#### Fetch products using name, category, subcategory
66
66
-[GET]`/products?name=<name: string>` - Get product with name: `name` <br/><br/>
67
-
-[GET]`/subcategories/<subcategory_id: int>/products?page=<page_no>` - Get product with within subcategory `subcategory`. Returns `page_no` of the paginated results. <br/><br/>
68
-
-[GET]`/categories/<category_id: int>/products` - Get product with within category `category`. Returns first page of the paginated results. <br/><br/>
69
-
-[GET]`/categories/<category_id: int>/products?page=<page_no>` - Get product with within category `category`. Returns `page_no` of the paginated results. <br/><br/>
67
+
-[GET]`/subcategories/<subcategory_id: int>/products` - Get first page of products within subcategory `subcategory_id`. <br/><br/>
68
+
-[GET]`/subcategories/<subcategory_id: int>/products?cursor=<cursor: str>` - Get products paginated using cursor within subcategory `subcategory_id`. Next and previous page `cursors` provided in responses. <br/><br/>
69
+
-[GET]`/categories/<category_id: int>/products` - Get first page of products within category `category_id`. <br/><br/>
70
+
-[GET]`/categories/<category_id: int>/products?cursor=<cursor: str>` - Get products paginated using cursor within category `category_id`. Next and previous page `cursors` provided in responses. <br/><br/>
70
71
71
72
72
73
#### Authorization
@@ -150,7 +151,8 @@ Test the API using Swagger UI (`/` route), Postman, cURL or your preferred HTTP
150
151
<br/>
151
152
152
153
#### Product
153
-
-[GET]`/products` - Get all products
154
+
-[GET]`/products` - Get first page of products
155
+
-[GET]`/products?cursor=<cursor: str>` - Get products paginated using cursor. Next and previous page `cursors` provided in responses.
154
156
-[GET]`/products/(int: product_id)` - Get product with product_id
155
157
-[GET]`/products/(int: product_id)/subcategories` - Get subcategories related to product_id
156
158
-[DELETE]`/products/(int: product_id)` (Protected) - Delete product with product_id
0 commit comments