MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getSingleUserOrganization

Function getSingleUserOrganization

apps/web/src/lib/organizations/organizations.ts:141–150  ·  view source on GitHub ↗
(userId: User['id'])

Source from the content-addressed store, hash-verified

139 })
140 .from(organization_memberships)
141 .innerJoin(organizations, eq(organizations.id, organization_memberships.organization_id))
142 .where(
143 and(eq(organization_memberships.kilo_user_id, userId), isNull(organizations.deleted_at))
144 );
145 return rows;
146}
147
148export async function userHasOrganizations(userId: User['id']): Promise<boolean> {
149 const result = await db
150 .select({ id: organization_memberships.id })
151 .from(organization_memberships)
152 .innerJoin(organizations, eq(organizations.id, organization_memberships.organization_id))
153 .where(and(eq(organization_memberships.kilo_user_id, userId), isNull(organizations.deleted_at)))

Callers 1

getProfileRedirectPathFunction · 0.90

Calls 1

limitMethod · 0.65

Tested by

no test coverage detected