fix: API build (#10639)

pull/10641/head^2
Omar López 2023-08-07 18:01:23 -07:00 committed by GitHub
parent 46de1a8518
commit 6b536030fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 3 deletions

View File

@ -2,7 +2,6 @@ import type { NextApiRequest } from "next";
import { z } from "zod"; import { z } from "zod";
import { getUserAvailability } from "@calcom/core/getUserAvailability"; import { getUserAvailability } from "@calcom/core/getUserAvailability";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
import { HttpError } from "@calcom/lib/http-error"; import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server"; import { defaultResponder } from "@calcom/lib/server";
import { availabilityUserSelect } from "@calcom/prisma"; import { availabilityUserSelect } from "@calcom/prisma";
@ -120,10 +119,8 @@ const availabilitySchema = z
async function handler(req: NextApiRequest) { async function handler(req: NextApiRequest) {
const { prisma, isAdmin, userId: reqUserId } = req; const { prisma, isAdmin, userId: reqUserId } = req;
const { username, userId, eventTypeId, dateTo, dateFrom, teamId } = availabilitySchema.parse(req.query); const { username, userId, eventTypeId, dateTo, dateFrom, teamId } = availabilitySchema.parse(req.query);
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(req.headers.host ?? "");
if (!teamId) if (!teamId)
return getUserAvailability({ return getUserAvailability({
orgSlug: isValidOrgDomain ? currentOrgDomain || undefined : undefined,
username, username,
dateFrom, dateFrom,
dateTo, dateTo,