Skip to content

Commit a301eb8

Browse files
committed
address comments
1 parent 3ab3a0c commit a301eb8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • apps/sim/app/api/credentials/[id]/members

apps/sim/app/api/credentials/[id]/members/route.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)