fix: Import prisma (#11369)

Co-authored-by: zomars <[email protected]>
This commit is contained in:
Keith Williamsandzomars authored and GitHub committed 2023-09-14 19:47:25 +00:00
1 parent d60fb081c9
commit bd21b2dfe1
3 files changed
+9 -5

No files matched your search

@@ -300,7 +300,7 @@ export const findPaymentCredentials = async (
): Promise<{ clientId: string; secretKey: string; webhookId: string }> => {
try {
// @TODO: what about team bookings with paypal?
const userFromBooking = await prisma?.booking.findFirst({
const userFromBooking = await prisma.booking.findFirst({
where: {
id: bookingId,
},
@@ -312,7 +312,7 @@ export const findPaymentCredentials = async (
if (!userFromBooking) throw new Error("No user found");
const credentials = await prisma?.credential.findFirst({
const credentials = await prisma.credential.findFirst({
where: {
appId: "paypal",
userId: userFromBooking?.userId,
@@ -1,3 +1,5 @@
import type { PrismaClient } from "@calcom/prisma";
import type { TrpcSessionUser } from "../../../../trpc";
import { getHandler } from "./get.handler";
import type { TGetByUserIdInputSchema } from "./getScheduleByUserId.schema";
@@ -5,6 +7,7 @@ import type { TGetByUserIdInputSchema } from "./getScheduleByUserId.schema";
type GetOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
prisma: PrismaClient;
};
input: TGetByUserIdInputSchema;
};
@@ -12,7 +15,7 @@ type GetOptions = {
const EMPTY_SCHEDULE = [[], [], [], [], [], [], []];
export const getScheduleByUserIdHandler = async ({ ctx, input }: GetOptions) => {
const foundUserDefaultId = await prisma.user.findUnique({
const foundUserDefaultId = await ctx.prisma.user.findUnique({
where: {
id: input.userId,
},