Files
calendar/packages/trpc/server/routers/viewer/bookings/find.handler.ts
T
2021b641ce feat: Alby integration (#11495)
Co-authored-by: Peer Richelsen <peer@cal.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-09-28 12:03:01 +00:00

37 lines
695 B
TypeScript

import type { PrismaClient } from "@calcom/prisma";
import type { TFindInputSchema } from "./find.schema";
type GetOptions = {
ctx: {
prisma: PrismaClient;
};
input: TFindInputSchema;
};
export const getHandler = async ({ ctx, input }: GetOptions) => {
const { prisma } = ctx;
const { bookingUid } = input;
const booking = await prisma.booking.findUnique({
where: {
uid: bookingUid,
},
select: {
id: true,
uid: true,
startTime: true,
endTime: true,
description: true,
status: true,
paid: true,
eventTypeId: true,
},
});
// Don't leak anything private from the booking
return {
booking,
};
};