From 75be1d6b3d9bf7b5d71613b3f169a942b1d25e7e Mon Sep 17 00:00:00 2001 From: panteliselef Date: Fri, 15 Sep 2023 18:40:42 +0300 Subject: [PATCH] fix(backend): Populate members_count of an Organization (#1735) --- .changeset/nice-games-rule.md | 5 +++++ packages/backend/src/api/resources/JSON.ts | 1 + packages/backend/src/api/resources/Organization.ts | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 .changeset/nice-games-rule.md diff --git a/.changeset/nice-games-rule.md b/.changeset/nice-games-rule.md new file mode 100644 index 0000000000..41d7e4a42d --- /dev/null +++ b/.changeset/nice-games-rule.md @@ -0,0 +1,5 @@ +--- +'@clerk/backend': patch +--- + +Fix missing members_count property for an Organization diff --git a/packages/backend/src/api/resources/JSON.ts b/packages/backend/src/api/resources/JSON.ts index 4c5be9fffc..bbbe53c4a6 100644 --- a/packages/backend/src/api/resources/JSON.ts +++ b/packages/backend/src/api/resources/JSON.ts @@ -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 { diff --git a/packages/backend/src/api/resources/Organization.ts b/packages/backend/src/api/resources/Organization.ts index 7d5172f9ce..ac1dcdc7c1 100644 --- a/packages/backend/src/api/resources/Organization.ts +++ b/packages/backend/src/api/resources/Organization.ts @@ -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 { @@ -35,6 +36,7 @@ export class Organization { data.private_metadata, data.max_allowed_memberships, data.admin_delete_enabled, + data.members_count, ); } }