fix: No type errors in build (#20075)

This commit is contained in:
Sarvesh Bajaj
2025-03-14 07:39:10 +00:00
committed by GitHub
parent 194719e7ba
commit 21d87d5a80
3 changed files with 10 additions and 8 deletions
@@ -1,4 +1,4 @@
import type { Prisma } from "@prisma/client";
import { Prisma } from "@prisma/client";
import type { GetServerSidePropsContext } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { z } from "zod";
@@ -78,7 +78,7 @@ const getAppBySlug = async (appSlug: string) => {
};
const getEventTypes = async (userId: number, teamIds?: number[]) => {
const eventTypeSelect: Prisma.EventTypeSelect = {
const eventTypeSelect = Prisma.validator<Prisma.EventTypeSelect>()({
id: true,
description: true,
durationLimits: true,
@@ -99,7 +99,7 @@ const getEventTypes = async (userId: number, teamIds?: number[]) => {
userId: true,
destinationCalendar: true,
bookingFields: true,
};
});
let eventTypeGroups: TEventTypeGroup[] | null = [];
if (teamIds && teamIds.length > 0) {
@@ -1,6 +1,7 @@
import dayjs from "@calcom/dayjs";
import prisma from "@calcom/prisma";
import type { EventType, Prisma, User, WorkflowReminder, WorkflowStep } from "@calcom/prisma/client";
import type { EventType, User, WorkflowReminder, WorkflowStep } from "@calcom/prisma/client";
import { Prisma } from "@calcom/prisma/client";
import { WorkflowMethods } from "@calcom/prisma/enums";
type PartialWorkflowStep =
@@ -118,7 +119,7 @@ export async function getAllRemindersToCancel(): Promise<RemindersToCancelType[]
return remindersToCancel;
}
export const select: Prisma.WorkflowReminderSelect = {
export const select = Prisma.validator<Prisma.WorkflowReminderSelect>()({
id: true,
scheduledDate: true,
isMandatoryReminder: true,
@@ -193,7 +194,7 @@ export const select: Prisma.WorkflowReminderSelect = {
},
},
},
};
});
export async function getAllUnscheduledReminders(): Promise<PartialWorkflowReminder[]> {
const whereFilter: Prisma.WorkflowReminderWhereInput = {
@@ -1,4 +1,4 @@
import type { Prisma } from "@prisma/client";
import { Prisma } from "@prisma/client";
import { prisma } from "@calcom/prisma";
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
@@ -201,7 +201,8 @@ export class SelectedCalendarRepository {
}
static async findMany({ where, select, orderBy }: FindManyArgs) {
return await prisma.selectedCalendar.findMany({ where, select, orderBy });
const args = Prisma.validator<Prisma.SelectedCalendarFindManyArgs>()({ where, select, orderBy });
return await prisma.selectedCalendar.findMany(args);
}
static async findUniqueOrThrow({ where }: { where: Prisma.SelectedCalendarWhereInput }) {