Skip to content

UpdateParams in OrganizationApi is missing adminDeleteEnabled #6879

@ccaspanello

Description

@ccaspanello

Preliminary Checks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageA ticket that needs to be triaged by a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions