diff --git a/apps/api/v2/src/modules/organizations/users/index/organizations-users.repository.ts b/apps/api/v2/src/modules/organizations/users/index/organizations-users.repository.ts index fe10bdf989..282af31bb4 100644 --- a/apps/api/v2/src/modules/organizations/users/index/organizations-users.repository.ts +++ b/apps/api/v2/src/modules/organizations/users/index/organizations-users.repository.ts @@ -141,7 +141,16 @@ export class OrganizationsUsersRepository { return await this.dbWrite.prisma.user.delete({ where: { id: userId, - organizationId: orgId, + OR: [ + { organizationId: orgId }, + { + profiles: { + some: { + organizationId: orgId, + }, + }, + }, + ], }, include: { profiles: {