This reverts commit 77c8e34073.
This commit is contained in:
1 parent
d4ea931bf8
commit
20dfa93527
3 files changed
+21
-185
No files matched your search
@@ -1,10 +1,11 @@
|
||||
import { CreationSource } from "@calcom/platform-libraries";
|
||||
import type { Prisma, Profile, Team, User } from "@calcom/prisma/client";
|
||||
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
|
||||
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
||||
import { CreateManagedUserInput } from "@/modules/users/inputs/create-managed-user.input";
|
||||
import { UpdateManagedUserInput } from "@/modules/users/inputs/update-managed-user.input";
|
||||
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||
|
||||
import { CreationSource } from "@calcom/platform-libraries";
|
||||
import type { Profile, User, Team, Prisma } from "@calcom/prisma/client";
|
||||
|
||||
export type UserWithProfile = User & {
|
||||
movedToProfile?: (Profile & { organization: Pick<Team, "isPlatform" | "id" | "slug" | "name"> }) | null;
|
||||
@@ -13,10 +14,7 @@ export type UserWithProfile = User & {
|
||||
|
||||
@Injectable()
|
||||
export class UsersRepository {
|
||||
constructor(
|
||||
private readonly dbRead: PrismaReadService,
|
||||
private readonly dbWrite: PrismaWriteService
|
||||
) {}
|
||||
constructor(private readonly dbRead: PrismaReadService, private readonly dbWrite: PrismaWriteService) {}
|
||||
|
||||
async create(
|
||||
user: CreateManagedUserInput,
|
||||
@@ -184,15 +182,6 @@ export class UsersRepository {
|
||||
});
|
||||
}
|
||||
|
||||
async findByUsernameExcludingOrgUsers(username: string) {
|
||||
return this.dbRead.prisma.user.findFirst({
|
||||
where: {
|
||||
username,
|
||||
profiles: { none: {} },
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findManagedUsersByOAuthClientId(oauthClientId: string, cursor: number, limit: number) {
|
||||
return this.dbRead.prisma.user.findMany({
|
||||
where: {
|
||||
|
||||
Reference in new issue
Block a user