22 lines
643 B
TypeScript
22 lines
643 B
TypeScript
import { ScheduleRepository } from "@calcom/features/schedules/repositories/ScheduleRepository";
|
|
|
|
import type { TrpcSessionUser } from "../../../../types";
|
|
import type { TGetInputSchema } from "./get.schema";
|
|
|
|
type GetOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TGetInputSchema;
|
|
};
|
|
|
|
export const getHandler = async ({ ctx, input }: GetOptions) => {
|
|
return await ScheduleRepository.findDetailedScheduleById({
|
|
scheduleId: input.scheduleId,
|
|
isManagedEventType: input.isManagedEventType,
|
|
userId: ctx.user.id,
|
|
timeZone: ctx.user.timeZone,
|
|
defaultScheduleId: ctx.user.defaultScheduleId,
|
|
});
|
|
};
|