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

Function resolveOrganization

apps/cloud/src/auth/organization.ts:42–57  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

40// read-path healing.
41
42export const resolveOrganization = (organizationId: string) =>
43 Effect.gen(function* () {
44 const users = yield* UserStoreService;
45 const existing = yield* users.use("getOrganization", (s) => s.getOrganization(organizationId));
46 if (existing) return existing;
47
48 const workos = yield* WorkOSClient;
49 const fresh = yield* workos.getOrganization(organizationId);
50 return yield* users.use("upsertOrganization", (s) =>
51 s.upsertOrganization({
52 id: fresh.id,
53 name: fresh.name,
54 updatedAt: new Date(fresh.updatedAt),
55 }),
56 );
57 });
58
59// ---------------------------------------------------------------------------
60// Deletion mark — the local step that revokes an organization.

Callers 5

resolveBearerAuthFunction · 0.90
handlers.tsFile · 0.90
handlers.tsFile · 0.90
organizationFromDatabaseFunction · 0.90
heldOrResolvedForMemberFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected