File tree Expand file tree Collapse file tree
apps/sim/app/api/credentials/[id]/members Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,7 +210,12 @@ export const POST = withRouteHandler(async (request: NextRequest, context: Route
210210 . where ( eq ( credentialMember . id , existing . id ) )
211211 . limit ( 1 )
212212 . for ( 'update' )
213- if ( current ?. role === 'admin' && current ?. status === 'active' && role !== 'admin' ) {
213+ if (
214+ ! isSharedCredentialType ( admin . credentialType ) &&
215+ current ?. role === 'admin' &&
216+ current ?. status === 'active' &&
217+ role !== 'admin'
218+ ) {
214219 const activeAdmins = await tx
215220 . select ( { id : credentialMember . id } )
216221 . from ( credentialMember )
@@ -345,7 +350,7 @@ export const DELETE = withRouteHandler(async (request: NextRequest, context: Rou
345350 }
346351
347352 const revoked = await db . transaction ( async ( tx ) => {
348- if ( target . role === 'admin' ) {
353+ if ( ! isSharedCredentialType ( admin . credentialType ) && target . role === 'admin' ) {
349354 const activeAdmins = await tx
350355 . select ( { id : credentialMember . id } )
351356 . from ( credentialMember )
You can’t perform that action at this time.
0 commit comments