Skip to content

Commit

Permalink
Add profile_picture_url attribute to the user object (#958)
Browse files Browse the repository at this point in the history
## Description

## Documentation

Does this require changes to the WorkOS Docs? E.g. the [API
Reference](https://workos.com/docs/reference) or code snippets need
updates.

```
[ ] Yes
```

If yes, link a related docs PR and add a docs maintainer as a reviewer.
Their approval is required.
  • Loading branch information
hadihallak authored Feb 7, 2024
1 parent 943d941 commit 5998ef8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/user-management/fixtures/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"last_name": "User",
"created_at": "2023-07-18T02:07:19.911Z",
"updated_at": "2023-07-18T02:07:19.911Z",
"email_verified": true
"email_verified": true,
"profile_picture_url": "https://example.com/profile_picture.jpg"
}
2 changes: 2 additions & 0 deletions src/user-management/interfaces/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface User {
id: string;
email: string;
emailVerified: boolean;
profilePictureUrl: string | null;
firstName: string | null;
lastName: string | null;
createdAt: string;
Expand All @@ -14,6 +15,7 @@ export interface UserResponse {
id: string;
email: string;
email_verified: boolean;
profile_picture_url: string | null;
first_name: string | null;
last_name: string | null;
created_at: string;
Expand Down
1 change: 1 addition & 0 deletions src/user-management/serializers/user.serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const deserializeUser = (user: UserResponse): User => ({
email: user.email,
emailVerified: user.email_verified,
firstName: user.first_name,
profilePictureUrl: user.profile_picture_url,
lastName: user.last_name,
createdAt: user.created_at,
updatedAt: user.updated_at,
Expand Down
4 changes: 4 additions & 0 deletions src/user-management/user-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('UserManagement', () => {
object: 'user',
id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS',
email: 'test01@example.com',
profilePictureUrl: 'https://example.com/profile_picture.jpg',
firstName: 'Test 01',
lastName: 'User',
emailVerified: true,
Expand Down Expand Up @@ -93,6 +94,7 @@ describe('UserManagement', () => {
firstName: 'Test 01',
lastName: 'User',
emailVerified: true,
profilePictureUrl: 'https://example.com/profile_picture.jpg',
createdAt: '2023-07-18T02:07:19.911Z',
updatedAt: '2023-07-18T02:07:19.911Z',
});
Expand Down Expand Up @@ -380,6 +382,7 @@ describe('UserManagement', () => {
});
expect(resp).toMatchObject({
email: 'test01@example.com',
profilePictureUrl: 'https://example.com/profile_picture.jpg',
});
});

Expand All @@ -399,6 +402,7 @@ describe('UserManagement', () => {
});
expect(resp).toMatchObject({
email: 'test01@example.com',
profilePictureUrl: 'https://example.com/profile_picture.jpg',
});
});
});
Expand Down

0 comments on commit 5998ef8

Please sign in to comment.