Skip to content

Commit c37e20c

Browse files
committed
refactor(credentials): remove unused getWorkspaceMemberUserIds
All callers now derive member IDs from workspace permission rows directly, making this function dead code.
1 parent ad7ee85 commit c37e20c

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

apps/sim/lib/credentials/environment.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,6 @@ function getPostgresErrorCode(error: unknown): string | undefined {
1616
return err.code || err.cause?.code
1717
}
1818

19-
export async function getWorkspaceMemberUserIds(workspaceId: string): Promise<string[]> {
20-
const [workspaceRows, permissionRows] = await Promise.all([
21-
db
22-
.select({ ownerId: workspace.ownerId })
23-
.from(workspace)
24-
.where(eq(workspace.id, workspaceId))
25-
.limit(1),
26-
db
27-
.select({ userId: permissions.userId })
28-
.from(permissions)
29-
.where(and(eq(permissions.entityType, 'workspace'), eq(permissions.entityId, workspaceId))),
30-
])
31-
const workspaceRow = workspaceRows[0]
32-
33-
const memberIds = new Set<string>(permissionRows.map((row) => row.userId))
34-
if (workspaceRow?.ownerId) {
35-
memberIds.add(workspaceRow.ownerId)
36-
}
37-
return Array.from(memberIds)
38-
}
39-
4019
export async function getUserWorkspaceIds(userId: string): Promise<string[]> {
4120
const [permissionRows, ownedWorkspaceRows] = await Promise.all([
4221
db

0 commit comments

Comments
 (0)