Skip to content

Commit 4e1d607

Browse files
committed
address bugbot comments
1 parent e23ef7c commit 4e1d607

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

apps/sim/app/api/credentials/route.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,7 @@ export async function GET(request: NextRequest) {
220220
await syncWorkspaceOAuthCredentialsForUser({ workspaceId, userId: session.user.id })
221221
}
222222

223-
const whereClauses = [
224-
eq(credential.workspaceId, workspaceId),
225-
eq(credentialMember.userId, session.user.id),
226-
eq(credentialMember.status, 'active'),
227-
]
223+
const whereClauses = [eq(credential.workspaceId, workspaceId)]
228224

229225
if (type) {
230226
whereClauses.push(eq(credential.type, type))
@@ -458,7 +454,10 @@ export async function POST(request: NextRequest) {
458454
id: crypto.randomUUID(),
459455
credentialId,
460456
userId: memberUserId,
461-
role: memberUserId === workspaceRow.ownerId ? 'admin' : 'member',
457+
role:
458+
memberUserId === workspaceRow.ownerId || memberUserId === session.user.id
459+
? 'admin'
460+
: 'member',
462461
status: 'active',
463462
joinedAt: now,
464463
invitedBy: session.user.id,

0 commit comments

Comments
 (0)