(orgId: string)
| 38 | } |
| 39 | |
| 40 | const fetchBillingStatus = async (orgId: string): Promise<BillingStatus> => { |
| 41 | const response = await fetch(`/api/orgs/${orgId}/billing/setup`) |
| 42 | |
| 43 | if (!response.ok) { |
| 44 | const error = await response.json() |
| 45 | throw new Error(error.error || 'Failed to fetch billing status') |
| 46 | } |
| 47 | |
| 48 | return response.json() |
| 49 | } |
| 50 | |
| 51 | export function useOrganizationData(orgSlug: string) { |
| 52 | const { status } = useSession() |
no test coverage detected