Skip to content

Commit

Permalink
(#146) API contract for adding a colors property to exisitng users
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-geekyants committed Aug 5, 2023
1 parent fbb6328 commit f287dff
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions user-migrations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Collection - Users

## API Endpoints

| Route | Description |
| :---------------------------------------------------------------------------------------: | :--------------------------------------------------------------: |
| [PATCH /migrations/addDefaultColorProperty](#patch-migrations-add_default_color_property) | Adds a colors property all to users, without the colors property |

## PATCH /migrations/addDefaultColorProperty

Adds a colors field to every exisiting user.

- **Params**
None
- **Query**
None
- **Headers**
Content-Type: application/json
- **Cookie**
rds-session: `<JWT>`
- **Success Response:**

- **Code:** 200

- **Content:**

```json
{
"message": "String",
"usersDetails": {
"count": Number,
"users": Array<String>
}

}
```

- **Error Response:**

- **Code:** 401

- **Content:**
```json
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Unauthenticated User."
}
```

- **Code:** 500
- **Content:**
```json
{
"message": "The server has encountered an unexpected error. Please contact the administrator for more information."
}
```

- **Example for updating an existing user documents:**
PATCH /migrations/addDefaultColorProperty<br/>
Content-Type: application/json<br/>
Request-Body:<br/>
None
Response :
Status 200 OK <br/>
Content-Type: application/json<br/>

```json
{
"usersDetails": {
"count": 3,
"users": ["ankur_1010", "ankur", "vivek"]
},
"message": "User colors updated successfully!"
}
```

0 comments on commit f287dff

Please sign in to comment.