Skip to content

Commit

Permalink
chore(backend): Update types to allow creating organizations without …
Browse files Browse the repository at this point in the history
…initial owner
  • Loading branch information
LauraBeatris committed Nov 29, 2024
1 parent 8a28d1f commit 3026221
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-crabs-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Allow to create organizations without initial owner
2 changes: 1 addition & 1 deletion packages/backend/src/api/endpoints/OrganizationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type CreateParams = {
name: string;
slug?: string;
/* The User id for the user creating the organization. The user will become an administrator for the organization. */
createdBy: string;
createdBy?: string;
maxAllowedMemberships?: number;
} & MetadataParams;

Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/api/resources/Organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export class Organization {
readonly slug: string | null,
readonly imageUrl: string,
readonly hasImage: boolean,
readonly createdBy: string,
readonly createdAt: number,
readonly updatedAt: number,
readonly publicMetadata: OrganizationPublicMetadata | null = {},
readonly privateMetadata: OrganizationPrivateMetadata = {},
readonly maxAllowedMemberships: number,
readonly adminDeleteEnabled: boolean,
readonly membersCount?: number,
readonly createdBy?: string,
) {}

static fromJSON(data: OrganizationJSON): Organization {
Expand All @@ -24,14 +24,14 @@ export class Organization {
data.slug,
data.image_url || '',
data.has_image,
data.created_by,
data.created_at,
data.updated_at,
data.public_metadata,
data.private_metadata,
data.max_allowed_memberships,
data.admin_delete_enabled,
data.members_count,
data.created_by,
);
}
}

0 comments on commit 3026221

Please sign in to comment.