MCPcopy Index your code
hub / github.com/simstudioai/sim / fetchOrganizations

Function fetchOrganizations

apps/sim/hooks/queries/organization.ts:153–163  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

151 * Note: better-auth client does not support AbortSignal, so signal is accepted but not forwarded
152 */
153async 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

Callers 1

useOrganizationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected