(userId: string, scope: WorkspaceScope = 'active')
| 127 | } |
| 128 | |
| 129 | export async function listUserWorkspaces(userId: string, scope: WorkspaceScope = 'active') { |
| 130 | const rows = await listAccessibleWorkspaceRowsForUser(userId, scope) |
| 131 | |
| 132 | return rows.map(({ workspace: ws, permissionType }) => ({ |
| 133 | workspaceId: ws.id, |
| 134 | workspaceName: ws.name, |
| 135 | role: ws.ownerId === userId ? 'owner' : permissionType, |
| 136 | })) |
| 137 | } |
| 138 | |
| 139 | export interface ReassignBilledAccountResult { |
| 140 | reassigned: Array<{ workspaceId: string; newBilledAccountUserId: string }> |
no test coverage detected