( slug: string, )
| 25 | |
| 26 | // Query functions |
| 27 | const fetchOrganizationBySlug = async ( |
| 28 | slug: string, |
| 29 | ): Promise<OrganizationDetails> => { |
| 30 | const response = await fetch(`/api/orgs/slug/${slug}`) |
| 31 | |
| 32 | if (!response.ok) { |
| 33 | const error = await response.json() |
| 34 | throw new Error(error.error || 'Failed to fetch organization') |
| 35 | } |
| 36 | |
| 37 | return response.json() |
| 38 | } |
| 39 | |
| 40 | const fetchBillingStatus = async (orgId: string): Promise<BillingStatus> => { |
| 41 | const response = await fetch(`/api/orgs/${orgId}/billing/setup`) |
no test coverage detected