diff --git a/tasks/README.md b/tasks/README.md index b0d3916f..34b4d132 100644 --- a/tasks/README.md +++ b/tasks/README.md @@ -38,23 +38,23 @@ ## **Requests** -| Route | Description | -| :--------------------------------: | :---------------: | -| [GET /tasks](#get-tasks) | Returns all tasks | -| [GET /tasks/self](#get-tasksself) | Returns all tasks of a user | -| [POST /tasks](#post-tasks) | Creates new task | -| [PATCH /tasks/:id](#patch-tasksid) | Updates tasks | -| [GET /tasks/:username](#get-tasksusername) | Returns all tasks of the user | -| [PATCH /tasks/self/:id](#patch-tasksselfid) | Changes in own task | +| Route | Description | +| :-----------------------------------------: | :---------------------------: | +| [GET /tasks](#get-tasks) | Returns all tasks | +| [GET /tasks/self](#get-tasksself) | Returns all tasks of a user | +| [POST /tasks](#post-tasks) | Creates new task | +| [PATCH /tasks/:id](#patch-tasksid) | Updates tasks | +| [GET /tasks/:username](#get-tasksusername) | Returns all tasks of the user | +| [PATCH /tasks/self/:id](#patch-tasksselfid) | Changes in own task | ## **GET /tasks** -Returns all the tasks +Returns all the tasks or Returns all the tasks which are created after the `` whose "id" would be passed in the query `after`. The no. of returned documents is controlled by `limit`again from the query which will also have a default. - **Params** None - **Query** - None + _Required:_ limit=[number], after=[string(task id)] `(Only required for pagination)` - **Body** None - **Headers** @@ -67,11 +67,15 @@ Returns all the tasks ``` { - message: 'Tasks returned successfully!' + message: 'Queried Tasks returned successfully!', tasks: [ {}, {} - ] + ], + meta: { + total : {}[] length, + till : + }, } ``` @@ -79,7 +83,6 @@ Returns all the tasks - **Code:** 500 - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` - ## **GET /tasks/self** Returns all the completed tasks of user if query `completed=true` is passed, else returns all the active and blocked tasks of the user. @@ -97,6 +100,7 @@ Returns all the completed tasks of user if query `completed=true` is passed, els - **Success Response:** - **Code:** 200 - **Content:** + ``` [ {}, @@ -130,6 +134,7 @@ Returns all tasks of the requested user. - **Success Response:** - **Code:** 200 - **Content:** + ``` { message: 'Tasks returned successfully!' @@ -146,7 +151,6 @@ Returns all tasks of the requested user. - **Code:** 500 - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` - ## **POST /tasks** - **Params** @@ -199,10 +203,11 @@ Returns all tasks of the requested user. - **Headers** Content-Type: application/json -- **Body** +- **Body** + ``` - { - status: + { + status: percentCompleted: } ``` @@ -211,6 +216,7 @@ Returns all tasks of the requested user. rds-session: `` - **Success Response:** + - **Code**: 200 - **Content:** `{'message': 'Task updated successfully!'}` @@ -222,4 +228,4 @@ Returns all tasks of the requested user. - **Code:** 404 - **Content:** `{ 'statusCode': 404, 'error': 'Not Found', 'message': 'Task doesn't exist' }` - **Code:** 500 - - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` \ No newline at end of file + - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }`