( target: TargetShape, identity: Identity, name: string, )
| 140 | |
| 141 | /** Create another org for this account; returns the identity bound to it. */ |
| 142 | export const createOrg = ( |
| 143 | target: TargetShape, |
| 144 | identity: Identity, |
| 145 | name: string, |
| 146 | ): Effect.Effect<Identity> => |
| 147 | Effect.gen(function* () { |
| 148 | const response = yield* postJson(target, "/api/auth/create-organization", identity, { name }); |
| 149 | const created = (yield* Effect.promise(() => response.clone().json())) as { id: string }; |
| 150 | return withRefreshedSession(identity, response, created.id); |
| 151 | }); |
| 152 | |
| 153 | /** This identity, scoped to `organizationId` for the requests it makes. */ |
| 154 | export const inOrg = (identity: Identity, organizationId: string): Identity => ({ |
nothing calls this directly
no test coverage detected