(userId: string, organizationId: string)
| 173 | |
| 174 | // The mirror read: the caller's row, active or nothing. |
| 175 | const activeMembershipFromMirror = (userId: string, organizationId: string) => |
| 176 | Effect.gen(function* () { |
| 177 | const directory = yield* MemberDirectory; |
| 178 | const membership = yield* directory.membership(userId, organizationId); |
| 179 | if (!membership || membership.status !== "active") return null; |
| 180 | const active: ActiveMembership = { role: membership.role }; |
| 181 | return active; |
| 182 | }); |
| 183 | |
| 184 | // The authorized organization, or null for one marked deleted (unless the |
| 185 | // caller is the deletion flow). The membership already names the caller's |
no outgoing calls
no test coverage detected