chore: Renamed getSchedule to getAvailableSlots (#10626)

* refactor: renamed getScheldude to getAvailableSlots

* fix ts error

* romoved comment
This commit is contained in:
Nischal Gautam authored and GitHub committed 2023-08-07 15:00:01 +01:00
1 parent ffa3a454bb
commit 4d9047974e
3 files changed
+4 -6

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ import prisma from "@calcom/prisma";
import type { SchedulingType } from "@calcom/prisma/enums";
import type { BookingStatus } from "@calcom/prisma/enums";
import type { Slot } from "@calcom/trpc/server/routers/viewer/slots/types";
import { getSchedule } from "@calcom/trpc/server/routers/viewer/slots/util";
import { getAvailableSlots as getSchedule } from "@calcom/trpc/server/routers/viewer/slots/util";
// TODO: Mock properly
prismaMock.eventType.findUnique.mockResolvedValue(null);
@@ -1,5 +1,5 @@
import type { TGetScheduleInputSchema } from "./getSchedule.schema";
import { getSchedule } from "./util";
import { getAvailableSlots } from "./util";
type GetScheduleOptions = {
ctx: Record<string, unknown>;
@@ -7,5 +7,5 @@ type GetScheduleOptions = {
};
export const getScheduleHandler = async ({ input }: GetScheduleOptions) => {
return await getSchedule(input);
return await getAvailableSlots(input);
};
@@ -191,8 +191,7 @@ export function getRegularOrDynamicEventType(input: TGetScheduleInputSchema) {
return isDynamicBooking ? getDynamicEventType(input) : getEventType(input);
}
/** This should be called getAvailableSlots */
export async function getSchedule(input: TGetScheduleInputSchema) {
export async function getAvailableSlots(input: TGetScheduleInputSchema) {
if (input.debug === true) {
logger.setSettings({ minLevel: "debug" });
}
@@ -259,7 +258,6 @@ export async function getSchedule(input: TGetScheduleInputSchema) {
{ user: currentUser, eventType, currentSeats }
);
if (!currentSeats && _currentSeats) currentSeats = _currentSeats;
return {
timeZone,
workingHours,