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

Function countOrgMembers

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

Source from the content-addressed store, hash-verified

227// table and the count gates the first-run claim; reading through it keeps the
228// gate logic next to the writes.
229export const countOrgMembers = (auth: Auth, organizationId: string): Promise<number> =>
230 auth.$context.then(({ adapter }) =>
231 adapter.count({ model: "member", where: [{ field: "organizationId", value: organizationId }] }),
232 );
233
234// True when the single org has no members yet — the unclaimed first-run state.
235const 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