* Fetch all organizations for the current user * Note: Billing data is fetched separately via useSubscriptionData() to avoid duplicate calls * Note: better-auth client does not support AbortSignal, so signal is accepted but not forwarded
(_signal?: AbortSignal)
| 151 | * Note: better-auth client does not support AbortSignal, so signal is accepted but not forwarded |
| 152 | */ |
| 153 | async function fetchOrganizations(_signal?: AbortSignal) { |
| 154 | const [orgsResponse, activeOrgResponse] = await Promise.all([ |
| 155 | client.organization.list(), |
| 156 | client.organization.getFullOrganization(), |
| 157 | ]) |
| 158 | |
| 159 | return { |
| 160 | organizations: orgsResponse.data || [], |
| 161 | activeOrganization: activeOrgResponse.data, |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Hook to fetch all organizations |