* chore: DI available slots service repositories * remove configService from worker module * register scheduleRepo in availableSlotsModule * chore: bump platform libs * remove useless comment from prisma module * fix: availableSlotsModule to class deps * fix: repositoriesModule deps * chore: container pattern * refactor: move modules in DI folder * fixup! refactor: move modules in DI folder
20 lines
706 B
TypeScript
20 lines
706 B
TypeScript
import type { IncomingMessage } from "http";
|
|
|
|
import { getAvailableSlotsService } from "@calcom/lib/di/containers/available-slots";
|
|
|
|
import type { TGetTeamScheduleInputSchema } from "./getTeamSchedule.schema";
|
|
|
|
export type GetTeamScheduleOptions = {
|
|
ctx?: ContextForGetSchedule;
|
|
input: TGetTeamScheduleInputSchema;
|
|
};
|
|
|
|
interface ContextForGetSchedule extends Record<string, unknown> {
|
|
req?: (IncomingMessage & { cookies: Partial<{ [key: string]: string }> }) | undefined;
|
|
}
|
|
|
|
export const getTeamScheduleHandler = async ({ ctx, input }: GetTeamScheduleOptions) => {
|
|
const availableSlotsService = getAvailableSlotsService();
|
|
return await availableSlotsService.getAvailableSlots({ ctx, input });
|
|
};
|