Skip to content

Commit 10f4c55

Browse files
authored
Add organization name to list organization memberships (#1285)
## Description Serialize and surface the organization name in the list organization membership call. Addressing #1284 ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [X] No ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
1 parent 9e46100 commit 10f4c55

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

src/user-management/fixtures/list-organization-memberships.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS",
77
"user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS",
88
"organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS",
9+
"organization_name": "Example Organization",
910
"status": "active",
1011
"created_at": "2023-07-18T02:07:19.911Z",
1112
"updated_at": "2023-07-18T02:07:19.911Z"

src/user-management/interfaces/organization-membership.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface OrganizationMembership {
66
object: 'organization_membership';
77
id: string;
88
organizationId: string;
9+
organizationName: string;
910
status: OrganizationMembershipStatus;
1011
userId: string;
1112
createdAt: string;
@@ -17,6 +18,7 @@ export interface OrganizationMembershipResponse {
1718
object: 'organization_membership';
1819
id: string;
1920
organization_id: string;
21+
organization_name: string;
2022
status: OrganizationMembershipStatus;
2123
user_id: string;
2224
created_at: string;

src/user-management/serializers/organization-membership.serializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const deserializeOrganizationMembership = (
1010
id: organizationMembership.id,
1111
userId: organizationMembership.user_id,
1212
organizationId: organizationMembership.organization_id,
13+
organizationName: organizationMembership.organization_name,
1314
status: organizationMembership.status,
1415
createdAt: organizationMembership.created_at,
1516
updatedAt: organizationMembership.updated_at,

src/user-management/user-management.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,7 @@ describe('UserManagement', () => {
15111511
{
15121512
object: 'organization_membership',
15131513
organizationId: 'organization_01H5JQDV7R7ATEYZDEG0W5PRYS',
1514+
organizationName: 'Example Organization',
15141515
userId: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS',
15151516
status: 'active',
15161517
},

0 commit comments

Comments
 (0)