Skip to content

Commit 49b212e

Browse files
authored
update doc for #2123 (#187)
1 parent e8ce4b6 commit 49b212e

File tree

1 file changed

+48
-44
lines changed

1 file changed

+48
-44
lines changed

users/README.md

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'discordId': string,
2727
'tokens': {},
2828
'badges': []
29+
'disabled_roles':[]
2930
}
3031
```
3132

@@ -53,7 +54,7 @@ number and email address.
5354

5455
Returns all users in the system.
5556

56-
- **Params**
57+
- **Params**
5758
None
5859
- **Query**
5960
- Optional: `size=[integer]` (`size` is the number of users requested per page, value ranges between 1-100, and the default value is 100)
@@ -62,11 +63,11 @@ Returns all users in the system.
6263
- Optional: `next=[string]` (`next` is the id of the DB document to get the next batch/page of results after that document.)
6364
- Optional: `prev=[string]` (`prev` is the id of the DB document to get the previous batch/page of results before that document.)
6465
- 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) )
65-
- **Body**
66+
- **Body**
6667
None
67-
- **Headers**
68+
- **Headers**
6869
Content-Type: application/json
69-
- **Cookie**
70+
- **Cookie**
7071
rds-session: `<JWT>`
7172
- **Success Response:**
7273
- **Code:** 200
@@ -94,14 +95,14 @@ Returns all users in the system.
9495
9596
Returns the details of logged in user.
9697
97-
- **Params**
98+
- **Params**
9899
None
99100
- **Query** private=[boolean] private=[boolean]
100-
- **Body**
101+
- **Body**
101102
None
102-
- **Headers**
103+
- **Headers**
103104
Content-Type: application/json
104-
- **Cookie**
105+
- **Cookie**
105106
rds-session: `<JWT>`
106107
- **Success Response:**
107108
- **Code:** 200
@@ -124,13 +125,13 @@ Returns the details of logged in user.
124125
125126
Returns the specified user.
126127
127-
- **Params**
128+
- **Params**
128129
_Required:_ `userId=[string]`
129-
- **Body**
130+
- **Body**
130131
None
131-
- **Headers**
132+
- **Headers**
132133
Content-Type: application/json
133-
- **Cookie**
134+
- **Cookie**
134135
None
135136
- **Success Response:**
136137
- **Code:** 200
@@ -150,13 +151,13 @@ Returns the specified user.
150151
151152
Returns the specified user.
152153
153-
- **Params**
154+
- **Params**
154155
_Required:_ `username=[string]`
155-
- **Body**
156+
- **Body**
156157
None
157-
- **Headers**
158+
- **Headers**
158159
Content-Type: application/json
159-
- **Cookie**
160+
- **Cookie**
160161
None
161162
- **Success Response:**
162163
- **Code:** 200
@@ -173,13 +174,13 @@ Returns the specified user.
173174
174175
Returns the availability of username.
175176
176-
- **Params**
177+
- **Params**
177178
_Required:_ `username=[string]`
178-
- **Body**
179+
- **Body**
179180
None
180-
- **Headers**
181+
- **Headers**
181182
Content-Type: application/json
182-
- **Cookie**
183+
- **Cookie**
183184
rds-session: `<JWT>`
184185
- **Success Response:**
185186
- **Code:** 200
@@ -196,15 +197,15 @@ Returns the availability of username.
196197
197198
Returns badges assigned to the user
198199
199-
- **Params**
200+
- **Params**
200201
Required: `id=[string]`
201-
- **Query**
202+
- **Query**
202203
None
203-
- **Body**
204+
- **Body**
204205
None
205-
- **Headers**
206+
- **Headers**
206207
Content-Type: application/json
207-
- **Cookie**
208+
- **Cookie**
208209
None
209210
- **Success Response:**
210211
- **Code:** 200
@@ -219,7 +220,7 @@ Returns badges assigned to the user
219220
220221
Returns users based on the specified filters.
221222
222-
- **Params:**
223+
- **Params:**
223224
None
224225
225226
- **Query Parameters:**
@@ -232,10 +233,10 @@ Returns users based on the specified filters.
232233
- Optional: `verified=[string]` (Specifies if the user is verified. Possible values: "true", "false")
233234
- Optional: `time=[string]` (Specifies the time filter, e.g., "31d")
234235
235-
- **Body:**
236+
- **Body:**
236237
None
237238
238-
- **Headers:**
239+
- **Headers:**
239240
Content-Type: application/json
240241
rds-session: `<JWT>`
241242
@@ -274,13 +275,13 @@ Returns users based on the specified filters.
274275
275276
Creates a new User.
276277
277-
- **Params**
278+
- **Params**
278279
None
279-
- **Query**
280+
- **Query**
280281
None
281-
- **Headers**
282+
- **Headers**
282283
Content-Type: application/json
283-
- **Cookie**
284+
- **Cookie**
284285
rds-session: `<JWT>`
285286
- **Body** `{ <user_object> }`
286287
- **Success Response:**
@@ -296,20 +297,22 @@ Creates a new User.
296297
297298
## **PATCH /users/self**
298299
299-
Updates data of the User.
300+
Updates data of the User. Doesn't update if user is `(in_discord && !userDetailsIncomplete)`, Except for `disabled_roles` property.
300301
301-
- **Params**
302+
- **Params**
302303
None
303-
- **Query**
304+
- **Query**
304305
None
305-
- **Headers**
306+
- **Headers**
306307
Content-Type: application/json
307-
- **Cookie**
308+
- **Cookie**
308309
rds-session: `<JWT>`
309310
- **Body** `{ <user_object> }`
310311
- **Success Response:**
311312
- **Code:** 204
312313
- **Content:** `{ 'message': 'User updated successfully!'}`
314+
- **Code:** 200
315+
- **Content** `{ message: "Privilege modified successfully!", disabled_roles: string[] }`
313316
- **Error Response:**
314317
- **Code:** 404
315318
- **Content:**
@@ -320,6 +323,7 @@ Updates data of the User.
320323
- **Code:** 403
321324
- **Content:**
322325
`{ 'statusCode': 403, 'error': 'Forbidden', 'message': 'Cannot update username again'}`
326+
`{ 'statusCode': 403, 'error': 'Forbidden', 'message': 'Developers can only update disabled_roles. Use profile service for updating other attributes.'}`
323327
- **Code:** 503
324328
- **Content:**
325329
`{ 'statusCode': 503, 'error': 'Service Unavailable', 'message': 'Something went wrong please contact admin' }`
@@ -328,13 +332,13 @@ Updates data of the User.
328332
329333
Updates roles for the User.
330334
331-
- **Params**
335+
- **Params**
332336
_Required:_ `userId=[string]`
333-
- **Query**
337+
- **Query**
334338
None
335-
- **Headers**
339+
- **Headers**
336340
Content-Type: application/json
337-
- **Cookie**
341+
- **Cookie**
338342
rds-session: `<JWT>`
339343
- **Body**
340344
`{
@@ -365,13 +369,13 @@ Updates roles for the User.
365369
366370
Archive users if not in Discord.
367371
368-
- **Params**
372+
- **Params**
369373
None
370374
- **Query**
371375
- Optional: `debug=[boolean]`(`debug` when set to true returns additional result in response to help debugging)
372-
- **Headers**
376+
- **Headers**
373377
Content-Type: application/json
374-
- **Cookie**
378+
- **Cookie**
375379
rds-session: `<SUPERUSER JWT>`
376380
- **Body**
377381

0 commit comments

Comments
 (0)