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

Function getUserOrganization

apps/sim/lib/billing/organizations/membership.ts:1600–1614  ·  view source on GitHub ↗
(
  userId: string
)

Source from the content-addressed store, hash-verified

1598 * Get user's current organization membership (if any).
1599 */
1600export async function getUserOrganization(
1601 userId: string
1602): Promise<{ organizationId: string; role: string; memberId: string } | null> {
1603 const [memberRecord] = await db
1604 .select({
1605 organizationId: member.organizationId,
1606 role: member.role,
1607 memberId: member.id,
1608 })
1609 .from(member)
1610 .where(eq(member.userId, userId))
1611 .limit(1)
1612
1613 return memberRecord || null
1614}

Callers 5

isSameOrgMemberFunction · 0.90
acceptInvitationFunction · 0.90
ensureUserInOrganizationFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected