Skip to content

Commit 53a9261

Browse files
committed
feat: Add getInstanceOrganizationMembershipList
1 parent ac4f31c commit 53a9261

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.changeset/angry-clouds-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Adds `clerkClient.organizations.getInstanceOrganizationMembershipList`

packages/backend/src/api/endpoints/OrganizationApi.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ type GetOrganizationMembershipListParams = ClerkPaginationRequest<{
136136
createdAtAfter?: number;
137137
}>;
138138

139+
type GetInstanceOrganizationMembershipListParams = ClerkPaginationRequest<{
140+
/**
141+
* Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
142+
* By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order.
143+
*/
144+
orderBy?: WithSign<'phone_number' | 'email_address' | 'created_at' | 'first_name' | 'last_name' | 'username'>;
145+
}>;
146+
139147
type CreateOrganizationMembershipParams = {
140148
organizationId: string;
141149
userId: string;
@@ -303,6 +311,14 @@ export class OrganizationAPI extends AbstractAPI {
303311
});
304312
}
305313

314+
public async getInstanceOrganizationMembershipList(params: GetInstanceOrganizationMembershipListParams) {
315+
return this.request<PaginatedResourceResponse<OrganizationMembership[]>>({
316+
method: 'GET',
317+
path: '/organization_memberships',
318+
queryParams: params,
319+
});
320+
}
321+
306322
public async createOrganizationMembership(params: CreateOrganizationMembershipParams) {
307323
const { organizationId, ...bodyParams } = params;
308324
this.requireId(organizationId);

0 commit comments

Comments
 (0)