@@ -6,7 +6,7 @@ import { addUserToOrganization, orgHasAvailability } from "@/lib/authUtils";
66import { ErrorCode } from "@/lib/errorCodes" ;
77import { notFound , orgNotFound , ServiceError } from "@/lib/serviceError" ;
88import { getOrgMetadata , isHttpError , isServiceError } from "@/lib/utils" ;
9- import { prisma } from "@/prisma" ;
9+ import { __unsafePrisma } from "@/prisma" ;
1010import { render } from "@react-email/components" ;
1111import { generateApiKey , getTokenFromConfig } from "@sourcebot/shared" ;
1212import { ConnectionSyncJobStatus , OrgRole , Prisma , RepoIndexingJobStatus , RepoIndexingJobType } from "@sourcebot/db" ;
@@ -928,7 +928,7 @@ export const getOrgAccountRequests = async () => sew(() =>
928928 } ) ) ;
929929
930930export const createAccountRequest = async ( userId : string ) => sew ( async ( ) => {
931- const user = await prisma . user . findUnique ( {
931+ const user = await __unsafePrisma . user . findUnique ( {
932932 where : {
933933 id : userId ,
934934 } ,
@@ -938,7 +938,7 @@ export const createAccountRequest = async (userId: string) => sew(async () => {
938938 return notFound ( "User not found" ) ;
939939 }
940940
941- const org = await prisma . org . findUnique ( {
941+ const org = await __unsafePrisma . org . findUnique ( {
942942 where : {
943943 id : SINGLE_TENANT_ORG_ID ,
944944 } ,
@@ -948,7 +948,7 @@ export const createAccountRequest = async (userId: string) => sew(async () => {
948948 return notFound ( "Organization not found" ) ;
949949 }
950950
951- const existingRequest = await prisma . accountRequest . findUnique ( {
951+ const existingRequest = await __unsafePrisma . accountRequest . findUnique ( {
952952 where : {
953953 requestedById_orgId : {
954954 requestedById : userId ,
@@ -966,7 +966,7 @@ export const createAccountRequest = async (userId: string) => sew(async () => {
966966 }
967967
968968 if ( ! existingRequest ) {
969- await prisma . accountRequest . create ( {
969+ await __unsafePrisma . accountRequest . create ( {
970970 data : {
971971 requestedById : userId ,
972972 orgId : org . id ,
@@ -979,7 +979,7 @@ export const createAccountRequest = async (userId: string) => sew(async () => {
979979 // on user creation (the header isn't set when next-auth calls onCreateUser for some reason)
980980 const deploymentUrl = env . AUTH_URL ;
981981
982- const owner = await prisma . user . findFirst ( {
982+ const owner = await __unsafePrisma . user . findFirst ( {
983983 where : {
984984 orgs : {
985985 some : {
@@ -1030,7 +1030,7 @@ export const createAccountRequest = async (userId: string) => sew(async () => {
10301030} ) ;
10311031
10321032export const getMemberApprovalRequired = async ( ) : Promise < boolean | ServiceError > => sew ( async ( ) => {
1033- const org = await prisma . org . findUnique ( {
1033+ const org = await __unsafePrisma . org . findUnique ( {
10341034 where : {
10351035 id : SINGLE_TENANT_ORG_ID ,
10361036 } ,
@@ -1277,7 +1277,7 @@ export const getRepoImage = async (repoId: number): Promise<ArrayBuffer | Servic
12771277} ) ;
12781278
12791279export const getAnonymousAccessStatus = async ( ) : Promise < boolean | ServiceError > => sew ( async ( ) => {
1280- const org = await prisma . org . findUnique ( {
1280+ const org = await __unsafePrisma . org . findUnique ( {
12811281 where : { id : SINGLE_TENANT_ORG_ID } ,
12821282 } ) ;
12831283 if ( ! org ) {
0 commit comments