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
|[GET /tasks/:id/details](#get-tasksiddetails)| Get details of a particular task|
67
+
|[GET /tasks/:username](#get-tasksusername)| Returns all tasks of the user|
68
+
|[PATCH /tasks/self/:id](#patch-tasksselfid)|Changes in own task|
69
69
70
70
## **GET /tasks**
71
71
72
72
Returns all the tasks
73
73
74
74
-**Params**
75
75
None
76
-
-**Query**
76
+
-**Query**
77
77
- Optional: `dev=[boolean]` (`dev` is passed to get all tasks in the developer mode with features that are flagged)
78
78
- Optional: `status=[string]` (`status` is a case insenstive string with one of the following values [AVAILABLE, ASSIGNED, COMPLETED, IN_PROGRESS, BLOCKED, SMOKE_TESTING, NEEDS_REVIEW, IN_REVIEW, APPROVED, MERGED, SANITY_CHECK, REGRESSION_CHECK, RELEASED, VERIFIED, DONE, UNASSIGNED] which represents the status of the task)
79
79
- Optional: `assignee=[string]` (`assignee` can be assignee username in case of single assignee or multiple comma separated values in case of multiple assignee)
@@ -82,6 +82,7 @@ Returns all the tasks
82
82
- Optional: `size=[integer]` (`size` is the number of tasks requested per page. Range of value is 1-100. Default value is 5)
83
83
- Optional: `next=[string]` (`next` is id of the document to get next page of results from that document)
84
84
- Optional: `prev=[string]` (`prev` is id of the document to get prev page of results from that document)
85
+
- Optional: `orphaned=[boolean]` ( if orphaned is set to true with dev feature flag as true, it will return all the pending tasks which have assigned to users who have departed the discord server. )
85
86
-**Body**
86
87
None
87
88
-**Headers**
@@ -102,10 +103,16 @@ Returns all the tasks
102
103
}
103
104
```
104
105
106
+
-**Code:** 204 (for `orphaned=true` when no orphaned tasks exist)
107
+
108
+
-**Content:**`No Content`
109
+
105
110
-**Error Response:**
106
111
-**Code:** 500
107
112
-**Content:**`{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }`
108
-
113
+
-**Code:** 404 (for `orphaned=true` without `dev=true`)
114
+
-**Content:**
115
+
`{ 'message': 'Route not found' }`
109
116
110
117
## **GET /tasks/self**
111
118
@@ -124,6 +131,7 @@ Returns all the completed tasks of user if query `completed=true` is passed, els
124
131
-**Success Response:**
125
132
-**Code:** 200
126
133
-**Content:**
134
+
127
135
```
128
136
[
129
137
{<task_object>},
@@ -157,6 +165,7 @@ Returns details of a particular task
157
165
-**Success Response:**
158
166
-**Code:** 200
159
167
-**Content:**
168
+
160
169
```
161
170
{
162
171
"message":"task returned successfully",
@@ -187,6 +196,7 @@ Returns all tasks of the requested user.
187
196
-**Success Response:**
188
197
-**Code:** 200
189
198
-**Content:**
199
+
190
200
```
191
201
{
192
202
message: 'Tasks returned successfully!'
@@ -203,7 +213,6 @@ Returns all tasks of the requested user.
203
213
-**Code:** 500
204
214
-**Content:**`{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }`
205
215
206
-
207
216
## **POST /tasks**
208
217
209
218
-**Params**
@@ -265,10 +274,11 @@ Returns all tasks of the requested user.
265
274
-**Headers**
266
275
Content-Type: application/json
267
276
268
-
-**Body**
277
+
-**Body**
278
+
269
279
```
270
-
{
271
-
status: <new-status>
280
+
{
281
+
status: <new-status>
272
282
percentCompleted: <number>
273
283
}
274
284
```
@@ -278,6 +288,7 @@ Returns all tasks of the requested user.
278
288
279
289
-**Success Response:**
280
290
-**Code**: 200
291
+
281
292
```
282
293
{
283
294
message: 'Task updated successfully!'
@@ -292,6 +303,7 @@ Returns all tasks of the requested user.
292
303
}
293
304
}
294
305
```
306
+
295
307
-**Error Response:**
296
308
-**Code:** 401
297
309
-**Content:**`{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'User can not be authenticated' }`
|[GET /users](#get-users)|Returns all users in the system|
43
+
|[GET /users/self](#get-usersSelf)|Returns the logged in user's details|
44
+
|[GET /users/userId/:userId](#get-usersuseriduserid)|Returns user with given userId|
45
+
|[GET /users/:username](#get-usersusername)|Returns user with given username|
46
+
|[GET /users/:userId/badges](#get-usersidbadges)|Returns badges assigned to the user|
47
+
|[GET /users/search](#get-users-search)| Returns users based on specified filters |
48
+
|[POST /users](#post-users)|Creates a new User|
49
+
|[PATCH /users/self](#patch-usersself)|Updates data of the User|
50
+
|[PATCH /users/:id/temporary/data](#patch-usersidroles)|Updates user roles|
51
+
|[PATCH /users](#patch-users)|Archive users if not in discord|
52
52
53
53
## **GET /users**
54
54
@@ -64,14 +64,17 @@ Returns all users in the system.
64
64
- Optional: `next=[string]` (`next` is the id of the DB document to get the next batch/page of results after that document.)
65
65
- Optional: `prev=[string]` (`prev` is the id of the DB document to get the previous batch/page of results before that document.)
66
66
- Optional: `query=[string]` (`query` can be used to filter and/or sort users based on their PR and Issue status within a given date range. [Learn more](https://github.com/Real-Dev-Squad/website-backend/wiki/Filter-and-sort-users-based-on-PRs-and-Issues) )
67
+
- Optional: `departed=[boolean]` ( if departed is set to true with dev feature flag as true, it will return all the users who have departed the discord server with pending tasks assigned to them. )
67
68
-**Body**
68
69
None
69
70
-**Headers**
70
71
Content-Type: application/json
71
72
-**Cookie**
72
73
rds-session: `<JWT>`
73
74
-**Success Response:**
75
+
74
76
-**Code:** 200
77
+
75
78
-**Content:**
76
79
77
80
```
@@ -88,7 +91,9 @@ Returns all users in the system.
88
91
```
89
92
90
93
**If `/users?profile=true`**
94
+
91
95
- **Code:** 200
96
+
92
97
- **Content:**
93
98
94
99
```
@@ -97,10 +102,20 @@ Returns all users in the system.
97
102
}
98
103
```
99
104
105
+
**If `/users?departed=true&dev=true`**
106
+
107
+
- **Code:** 204 (for `departed=true` when no abandoned tasks exist)
@@ -406,27 +428,27 @@ Archive users if not in Discord.
406
428
407
429
```json
408
430
{
409
-
"message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.",
410
-
"data": {
411
-
"totalUsers": "number",
412
-
"totalUsersArchived": "number",
413
-
"totalOperationsFailed": "number"
414
-
}
431
+
"message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.",
432
+
"data": {
433
+
"totalUsers": "number",
434
+
"totalUsersArchived": "number",
435
+
"totalOperationsFailed": "number"
436
+
}
415
437
}
416
438
```
417
439
418
440
**Addition info if debug query is set to true**
419
441
420
442
```json
421
443
{
422
-
"message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.",
423
-
"data": {
424
-
"totalUsers": "number",
425
-
"totalUsersArchived": "number",
426
-
"totalOperationsFailed": "number",
427
-
"updatedUserDetails": "array",
428
-
"failedUserDetails": "array"
429
-
}
444
+
"message": "Successfully updated users archived role to true if in_discord role is false | Couldn't find any users currently inactive in Discord but not archived.",
445
+
"data": {
446
+
"totalUsers": "number",
447
+
"totalUsersArchived": "number",
448
+
"totalOperationsFailed": "number",
449
+
"updatedUserDetails": "array",
450
+
"failedUserDetails": "array"
451
+
}
430
452
}
431
453
```
432
454
@@ -438,9 +460,9 @@ Archive users if not in Discord.
438
460
439
461
```json
440
462
{
441
-
"statusCode": 401,
442
-
"error": "Unauthorized",
443
-
"message": "Unauthenticated User"
463
+
"statusCode": 401,
464
+
"error": "Unauthorized",
465
+
"message": "Unauthenticated User"
444
466
}
445
467
```
446
468
@@ -450,9 +472,9 @@ Archive users if not in Discord.
450
472
451
473
```json
452
474
{
453
-
"statusCode": 400,
454
-
"error": "Bad Request",
455
-
"message": "Invalid payload"
475
+
"statusCode": 400,
476
+
"error": "Bad Request",
477
+
"message": "Invalid payload"
456
478
}
457
479
```
458
480
@@ -462,8 +484,8 @@ Archive users if not in Discord.
0 commit comments