-
Notifications
You must be signed in to change notification settings - Fork 388
Description
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
Simple model change, will submit a PR for you
Publishable key
N/A
Description
While creating organizations with the SDK I noticed the ability to set the adminDeleteEnabled flag is not available.
This is my work around:
async createOrganization(request: CreateOrganizationRequest): Promise<Organization> {
const organization = await this.client.organizations.createOrganization(request);
const params: any = { adminDeleteEnabled: false };
// NOTE: The adminDeleteEnabled parameter is missing from the Clerk type.
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
await this.client.organizations.updateOrganization(organization.id, params);
return organization;
}
This parameter does work and is documented here (which is how I found it):
https://clerk.com/docs/reference/backend-api/tag/organizations/patch/organizations/%7Borganization_id%7D#tag/instance-settings/patch/instance/organization_settings
This simply needs to be added to the model here:
https://github.com/clerk/javascript/blob/main/packages/backend/src/api/endpoints/OrganizationApi.ts#L46
Environment
N/A