Upgrade an organization's plan. The exact plan transition is determined server-side based on the organization's current plan and eligibility.
(name: &str)
| 110 | /// The exact plan transition is determined server-side based on the |
| 111 | /// organization's current plan and eligibility. |
| 112 | fn slugify(name: &str) -> String { |
| 113 | let mut slug = String::new(); |
| 114 | let mut last_was_dash = false; |
| 115 | |
| 116 | for ch in name.chars().flat_map(char::to_lowercase) { |
| 117 | if ch.is_ascii_alphanumeric() { |
| 118 | slug.push(ch); |
| 119 | last_was_dash = false; |
| 120 | } else if !last_was_dash && !slug.is_empty() { |
| 121 | slug.push('-'); |
| 122 | last_was_dash = true; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | while slug.ends_with('-') { |
| 127 | slug.pop(); |
| 128 | } |
| 129 | |
| 130 | slug |
| 131 | } |
| 132 | |
| 133 | pub async fn upgrade_org(client: &StorageClient, slug: &str) -> TeamsResult<OrgInfo> { |
| 134 | debug!("Upgrading organization: slug={slug}"); |
no test coverage detected