Skip to content

Commit

Permalink
fix(backend): Populate members_count of an Organization (#1735)
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored Sep 15, 2023
1 parent 133b2c5 commit 75be1d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-games-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Fix missing members_count property for an Organization
1 change: 1 addition & 0 deletions packages/backend/src/api/resources/JSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export interface OrganizationJSON extends ClerkResourceJSON {
updated_at: number;
max_allowed_memberships: number;
admin_delete_enabled: boolean;
members_count?: number;
}

export interface OrganizationInvitationJSON extends ClerkResourceJSON {
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/api/resources/Organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class Organization {
readonly privateMetadata: OrganizationPrivateMetadata = {},
readonly maxAllowedMemberships: number,
readonly adminDeleteEnabled: boolean,
readonly members_count?: number,
) {}

static fromJSON(data: OrganizationJSON): Organization {
Expand All @@ -35,6 +36,7 @@ export class Organization {
data.private_metadata,
data.max_allowed_memberships,
data.admin_delete_enabled,
data.members_count,
);
}
}

0 comments on commit 75be1d6

Please sign in to comment.