diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts index 0634625667..ba96feb911 100644 --- a/packages/app-store/locations.ts +++ b/packages/app-store/locations.ts @@ -428,10 +428,11 @@ export const getTranslatedLocation = ( return translatedLocation; }; -export const getOrganizerInputLocationsType = () => { - const locationTypes: DefaultEventLocationType["type"] | EventLocationTypeFromApp["type"][] = []; - const locations = locationsTypes.filter((location) => !!location.organizerInputType); - locations?.forEach((l) => locationTypes.push(l.type)); +export const getOrganizerInputLocationTypes = () => { + const result: DefaultEventLocationType["type"] | EventLocationTypeFromApp["type"][] = []; - return locationTypes; + const locations = locationsTypes.filter((location) => !!location.organizerInputType); + locations?.forEach((l) => result.push(l.type)); + + return result; }; diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx index dc73cbe2da..42803e7ae2 100644 --- a/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx +++ b/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx @@ -1,7 +1,7 @@ import { useFormContext } from "react-hook-form"; import type { LocationObject } from "@calcom/app-store/locations"; -import { getOrganizerInputLocationsType } from "@calcom/app-store/locations"; +import { getOrganizerInputLocationTypes } from "@calcom/app-store/locations"; import type { GetBookingType } from "@calcom/features/bookings/lib/get-booking"; import getLocationOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect"; import { FormBuilderField } from "@calcom/features/form-builder/FormBuilderField"; @@ -107,14 +107,14 @@ export const BookingFields = ({ } if (field?.options) { - const organzierInputTypes = getOrganizerInputLocationsType(); - const organzierInputObj: Record = {}; + const organizerInputTypes = getOrganizerInputLocationTypes(); + const organizerInputObj: Record = {}; field.options.forEach((f) => { - if (f.value in organzierInputObj) { - organzierInputObj[f.value]++; + if (f.value in organizerInputObj) { + organizerInputObj[f.value]++; } else { - organzierInputObj[f.value] = 1; + organizerInputObj[f.value] = 1; } }); @@ -122,7 +122,7 @@ export const BookingFields = ({ return { ...field, value: - organzierInputTypes.includes(field.value) && organzierInputObj[field.value] > 1 + organizerInputTypes.includes(field.value) && organizerInputObj[field.value] > 1 ? field.label : field.value, };