(organizationId: string)
| 36 | // read-path healing. |
| 37 | |
| 38 | export const resolveOrganization = (organizationId: string) => |
| 39 | Effect.gen(function* () { |
| 40 | const users = yield* UserStoreService; |
| 41 | const existing = yield* users.use((s) => s.getOrganization(organizationId)); |
| 42 | if (existing) return existing; |
| 43 | |
| 44 | const workos = yield* WorkOSClient; |
| 45 | const fresh = yield* workos.getOrganization(organizationId); |
| 46 | return yield* users.use((s) => s.upsertOrganization({ id: fresh.id, name: fresh.name })); |
| 47 | }); |
| 48 | |
| 49 | // --------------------------------------------------------------------------- |
| 50 | // Authorization — live membership check against WorkOS. |
no outgoing calls
no test coverage detected