MCPcopy
hub / github.com/simstudioai/sim / countNonOrganizationOwnedWorkspaces

Function countNonOrganizationOwnedWorkspaces

apps/sim/lib/workspaces/policy.ts:368–375  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

366}
367
368async function countNonOrganizationOwnedWorkspaces(userId: string): Promise<number> {
369 const [result] = await db
370 .select({ value: count() })
371 .from(workspace)
372 .where(and(eq(workspace.ownerId, userId), isNull(workspace.organizationId)))
373
374 return result?.value ?? 0
375}
376
377/**
378 * Returns the userId of the organization owner, or `null` if the

Callers 1

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected