Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API contract for adding a colors property to existing users #147

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kindly fix the formatting

}

}
```

- **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
isVivek99 marked this conversation as resolved.
Show resolved Hide resolved
{
"usersDetails": {
"count": 3,
"users": ["ankur_1010", "ankur", "vivek"]
},
"message": "User colors updated successfully!"
}
```