Skip to content

Commit bbbbef6

Browse files
Update README with cursor paginated endpoints
1 parent 22cf0fc commit bbbbef6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Ability to create, read, update, and delete products, categories and subcategori
1010
<br></br>
1111
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.
1212
<br></br>
13-
Paginates result when products are fetched by categories or subcategories.
13+
Paginates result using cursor based pagination when products are fetched by categories, subcategories or themselves.
1414

1515
Deployed as a vercel function with Postgres: [ecommerce-rest-api-five.vercel.app](https://ecommerce-rest-api-five.vercel.app)
1616
<br> Documented with Swagger UI.
@@ -64,9 +64,10 @@ Test the API using Swagger UI (`/` route), Postman, cURL or your preferred HTTP
6464

6565
#### Fetch products using name, category, subcategory
6666
- [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/>
7071

7172

7273
#### Authorization
@@ -150,7 +151,8 @@ Test the API using Swagger UI (`/` route), Postman, cURL or your preferred HTTP
150151
<br/>
151152

152153
#### 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.
154156
- [GET] `/products/(int: product_id)` - Get product with product_id
155157
- [GET] `/products/(int: product_id)/subcategories` - Get subcategories related to product_id
156158
- [DELETE] `/products/(int: product_id)` (Protected) - Delete product with product_id

0 commit comments

Comments
 (0)