File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
apps/sim/app/api/credentials Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments