(account, headers, customDomain)
| 113 | } |
| 114 | |
| 115 | async function detachPagesDomain(account, headers, customDomain) { |
| 116 | const { ok, json } = await cf( |
| 117 | `${CF_API}/accounts/${account}/pages/projects`, |
| 118 | headers, |
| 119 | ); |
| 120 | if (!ok) { |
| 121 | throw new Error(`List Pages projects failed: ${JSON.stringify(json)}`); |
| 122 | } |
| 123 | |
| 124 | for (const project of json.result || []) { |
| 125 | const detached = await detachPagesDomainFromProject( |
| 126 | account, |
| 127 | headers, |
| 128 | project.name, |
| 129 | customDomain, |
| 130 | ); |
| 131 | |
| 132 | if (detached) return; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | async function detachPagesDomainFromProject( |
| 137 | account, |
no test coverage detected