* wip * add method to OrganizationRepository * server side fetching for availability * fix error * server side fetching finish * remove log * fix * fix * fix type * no need to export * fix type * address nit comments
22 lines
622 B
TypeScript
22 lines
622 B
TypeScript
import { ScheduleRepository } from "@calcom/lib/server/repository/schedule";
|
|
|
|
import type { TrpcSessionUser } from "../../../../trpc";
|
|
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,
|
|
});
|
|
};
|