Skip to content

Scheduling infrastructure for absolutely everyone.

chore: variables names (#12352)

Udit Takkarb94584973692
diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts
index 0634625667c..ba96feb9114 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"][] = [];
+export const getOrganizerInputLocationTypes = () => {
+ const result: DefaultEventLocationType["type"] | EventLocationTypeFromApp["type"][] = [];
+
const locations = locationsTypes.filter((location) => !!location.organizerInputType);
- locations?.forEach((l) => locationTypes.push(l.type));
+ locations?.forEach((l) => result.push(l.type));
- return locationTypes;
+ return result;
};
diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookingFields.tsx
index dc73cbe2da2..42803e7ae24 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<string, number> = {};
+ const organizerInputTypes = getOrganizerInputLocationTypes();
+ const organizerInputObj: Record<string, number> = {};
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,
};