Update [schedule].tsx

pull/3545/head
zomars 2022-07-26 17:53:43 -06:00
parent 39364d8476
commit c3ac1bcc8c
1 changed files with 5 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { DEFAULT_SCHEDULE, availabilityAsString } from "@calcom/lib/availability";
import { availabilityAsString, DEFAULT_SCHEDULE } from "@calcom/lib/availability";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import showToast from "@calcom/lib/notification";
import { inferQueryOutput, trpc } from "@calcom/trpc/react";
@ -127,12 +127,10 @@ export function AvailabilityForm(props: inferQueryOutput<"viewer.availability.sc
export default function Availability() {
const router = useRouter();
const { i18n } = useLocale();
const query = trpc.useQuery([
"viewer.availability.schedule",
{
scheduleId: parseInt(router.query.schedule as string),
},
]);
const query = trpc.useQuery(
["viewer.availability.schedule", { scheduleId: parseInt(router.query.schedule as string) }],
{ enabled: router.isReady }
);
const [name, setName] = useState<string>();
return (
<div>