fix formState and undefined value (#5576)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
alannnc
2022-11-22 16:27:47 +00:00
committed by GitHub
co-authored by kodiakhq[bot]
parent 1070cc2892
commit ba5d448811
2 changed files with 3 additions and 1 deletions
@@ -289,7 +289,7 @@ export const EventLimitsTab = ({ eventType }: Pick<EventTypeSetupInfered, "event
<SettingsToggle
title={t("limit_future_bookings")}
description={t("limit_future_bookings_description")}
checked={value !== "UNLIMITED"}
checked={value && value !== "UNLIMITED"}
onCheckedChange={(bool) => formMethods.setValue("periodType", bool ? "ROLLING" : "UNLIMITED")}>
<RadioGroup.Root
defaultValue={watchPeriodType}
@@ -164,6 +164,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
startDate: periodDates.startDate,
endDate: periodDates.endDate,
},
periodType: eventType.periodType,
periodCountCalendarDays: eventType.periodCountCalendarDays ? "1" : "0",
schedulingType: eventType.schedulingType,
minimumBookingNotice: eventType.minimumBookingNotice,
minimumBookingNoticeInDurationType: convertToNewDurationType(