@@ -10,7 +10,6 @@ import { z } from "zod";
10
10
import checkForMultiplePaymentApps from "@calcom/app-store/_utils/payments/checkForMultiplePaymentApps" ;
11
11
import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation" ;
12
12
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData" ;
13
- import { getLocationGroupedOptions } from "@calcom/app-store/server" ;
14
13
import type { EventTypeAppSettingsComponentProps , EventTypeModel } from "@calcom/app-store/types" ;
15
14
import { isConferencing as isConferencingApp } from "@calcom/app-store/utils" ;
16
15
import type { LocationObject } from "@calcom/core/location" ;
@@ -23,9 +22,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants";
23
22
import { CAL_URL } from "@calcom/lib/constants" ;
24
23
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage" ;
25
24
import { useLocale } from "@calcom/lib/hooks/useLocale" ;
26
- import { getTranslation } from "@calcom/lib/server" ;
27
25
import prisma from "@calcom/prisma" ;
28
- import { SchedulingType } from "@calcom/prisma/enums" ;
29
26
import { eventTypeBookingFields } from "@calcom/prisma/zod-utils" ;
30
27
import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils" ;
31
28
import { trpc } from "@calcom/trpc/react" ;
@@ -40,15 +37,13 @@ import { AccountsStepCard } from "@components/apps/installation/AccountsStepCard
40
37
import { ConfigureStepCard } from "@components/apps/installation/ConfigureStepCard" ;
41
38
import { EventTypesStepCard } from "@components/apps/installation/EventTypesStepCard" ;
42
39
import { StepHeader } from "@components/apps/installation/StepHeader" ;
43
- import type { TLocationOptions } from "@components/eventtype/Locations" ;
44
40
45
41
export type TEventType = EventTypeAppSettingsComponentProps [ "eventType" ] &
46
42
Pick <
47
43
EventTypeModel ,
48
44
"metadata" | "schedulingType" | "slug" | "requiresConfirmation" | "position" | "destinationCalendar"
49
45
> & {
50
46
selected : boolean ;
51
- locationOptions ?: TLocationOptions ;
52
47
locations : LocationFormValues [ "locations" ] ;
53
48
bookingFields ?: LocationFormValues [ "bookingFields" ] ;
54
49
} ;
@@ -529,41 +524,17 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
529
524
}
530
525
eventTypes = await getEventTypes ( user . id , parsedTeamIdParam ) ;
531
526
if ( isConferencing ) {
532
- const t = await getTranslation ( locale ?? "en" , "common" ) ;
533
- const locationOptions = await getLocationGroupedOptions ( { userId : user . id } , t ) ;
527
+ const destinationCalendar = await prisma . destinationCalendar . findFirst ( {
528
+ where : {
529
+ userId : user . id ,
530
+ eventTypeId : null ,
531
+ } ,
532
+ } ) ;
534
533
for ( let index = 0 ; index < eventTypes . length ; index ++ ) {
535
534
let eventType = eventTypes [ index ] ;
536
- let destinationCalendar = eventType . destinationCalendar ;
537
- if ( ! destinationCalendar ) {
538
- destinationCalendar = await prisma . destinationCalendar . findFirst ( {
539
- where : {
540
- userId : user . id ,
541
- eventTypeId : null ,
542
- } ,
543
- } ) ;
544
-
535
+ if ( ! eventType . destinationCalendar ) {
545
536
eventType = { ...eventType , destinationCalendar } ;
546
537
}
547
- if ( eventType . schedulingType === SchedulingType . MANAGED ) {
548
- eventType = {
549
- ...eventType ,
550
- locationOptions : [
551
- {
552
- label : t ( "default" ) ,
553
- options : [
554
- {
555
- label : t ( "members_default_location" ) ,
556
- value : "" ,
557
- icon : "/user-check.svg" ,
558
- } ,
559
- ] ,
560
- } ,
561
- ...locationOptions ,
562
- ] ,
563
- } ;
564
- } else {
565
- eventType = { ...eventType , locationOptions } ;
566
- }
567
538
eventTypes [ index ] = eventType ;
568
539
}
569
540
}
0 commit comments