()
| 3 | import { getErrorMessage } from "./http-errors"; |
| 4 | |
| 5 | export async function openUpgradeCheckout() { |
| 6 | const response = await apiClient.billing.checkout.$post(); |
| 7 | |
| 8 | if (response.ok) { |
| 9 | const data = await response.json(); |
| 10 | await open(data.url); |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | throw new Error(await getErrorMessage(response)); |
| 15 | }; |
| 16 | |
| 17 | export async function openBillingPortal() { |
| 18 | const response = await apiClient.billing.portal.$post(); |
no test coverage detected