MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / countOrgMembers

Function countOrgMembers

apps/host-selfhost/src/auth/better-auth.ts:327–330  ·  view source on GitHub ↗
(auth: Auth, organizationId: string)

Source from the content-addressed store, hash-verified

325// table and the count gates the first-run claim; reading through it keeps the
326// gate logic next to the writes.
327export const countOrgMembers = (auth: Auth, organizationId: string): Promise<number> =>
328 auth.$context.then(({ adapter }) =>
329 adapter.count({ model: "member", where: [{ field: "organizationId", value: organizationId }] }),
330 );
331
332// True when the single org has no members yet — the unclaimed first-run state.
333const orgHasNoMembers = async (gate: SignupGate): Promise<boolean> => {

Callers 2

handlers.tsFile · 0.90
orgHasNoMembersFunction · 0.85

Calls 1

countMethod · 0.80

Tested by

no test coverage detected