Remove a member from an organization. Returns an error if the member is the last owner ([`TeamsError::LastOwner`](crate::error::TeamsError::LastOwner) mapped from a 409 response). # Arguments `client` — Authenticated storage client. `org_slug` — URL-safe slug of the organization. `identity_id` — Identity of the member to remove.
(
client: &StorageClient,
org_slug: &str,
identity_id: Uuid,
)
| 106 | /// * `org_slug` — URL-safe slug of the organization. |
| 107 | /// * `identity_id` — Identity of the member to remove. |
| 108 | pub async fn remove_member( |
| 109 | client: &StorageClient, |
| 110 | org_slug: &str, |
| 111 | identity_id: Uuid, |
| 112 | ) -> TeamsResult<()> { |
| 113 | let path = format!("/orgs/{org_slug}/members/{identity_id}"); |
| 114 | client.delete(&path).await.map_err(|e| { |
| 115 | map_remote_error( |
| 116 | e, |
| 117 | format!("member identity {identity_id} in org {org_slug}"), |
| 118 | ) |
| 119 | }) |
| 120 | } |
| 121 | |
| 122 | #[cfg(test)] |
| 123 | mod tests { |
no test coverage detected