Type fixes

This commit is contained in:
zomars 2022-10-18 13:55:31 -06:00
parent 9118ca328f
commit 41689ecc92

View File

@ -1,8 +1,12 @@
import z from "zod";
import { handleErrorsJson } from "@calcom/lib/errors";
import { randomString } from "@calcom/lib/random";
import type { PartialReference } from "@calcom/types/EventManager";
import type { VideoApiAdapter, VideoCallData } from "@calcom/types/VideoApiAdapter";
const huddle01Schema = z.object({ url: z.string().url(), roomId: z.string() });
const Huddle01VideoApiAdapter = (): VideoApiAdapter => {
return {
getAvailability: () => {
@ -13,7 +17,8 @@ const Huddle01VideoApiAdapter = (): VideoApiAdapter => {
"https://wpss2zlpb9.execute-api.us-east-1.amazonaws.com/new-meeting?utmCampaign=cal.com&utmSource=partner&utmMedium=calendar"
);
const { url } = await handleErrorsJson(res);
const json = await handleErrorsJson(res);
const { url } = huddle01Schema.parse(json);
return Promise.resolve({
type: "huddle01_video",