@@ -10,10 +10,10 @@ import PrimaryButton from '@/tbpro/elements/PrimaryButton.vue';
1010import SecondaryButton from ' @/tbpro/elements/SecondaryButton.vue' ;
1111import BubbleSelect from ' @/tbpro/elements/BubbleSelect.vue' ;
1212import { DateFormatStrings , DEFAULT_SLOT_DURATION , SLOT_DURATION_OPTIONS } from ' @/definitions' ;
13- import { useFTUEStore } from ' @/stores/ftue-store' ;
13+ import { createFTUEStore } from ' @/stores/ftue-store' ;
1414import { useUserStore } from ' @/stores/user-store' ;
15- import { useCalendarStore } from ' @/stores/calendar-store' ;
16- import { useScheduleStore } from ' @/stores/schedule-store' ;
15+ import { createCalendarStore } from ' @/stores/calendar-store' ;
16+ import { createScheduleStore } from ' @/stores/schedule-store' ;
1717import {
1818 dayjsKey , callKey , isoWeekdaysKey ,
1919} from ' @/keys' ;
@@ -24,15 +24,14 @@ const dj = inject(dayjsKey);
2424const call = inject (callKey );
2525const isoWeekdays = inject (isoWeekdaysKey );
2626
27- const ftueStore = useFTUEStore ( );
27+ const ftueStore = createFTUEStore ( call );
2828const {
2929 hasNextStep, hasPreviousStep,
3030} = storeToRefs (ftueStore );
31- const { nextStep, previousStep } = ftueStore ;
3231const { errorMessage, infoMessage } = storeToRefs (ftueStore );
3332const user = useUserStore ();
34- const calendarStore = useCalendarStore ( );
35- const scheduleStore = useScheduleStore ( );
33+ const calendarStore = createCalendarStore ( call );
34+ const scheduleStore = createScheduleStore ( call );
3635const { connectedCalendars } = storeToRefs (calendarStore );
3736const { schedules } = storeToRefs (scheduleStore );
3837const { timeToBackendTime, timeToFrontendTime } = scheduleStore ;
@@ -95,8 +94,8 @@ const onSubmit = async () => {
9594 };
9695
9796 const data = schedules .value .length > 0
98- ? await scheduleStore .updateSchedule (call , schedules .value [0 ].id , scheduleData )
99- : await scheduleStore .createSchedule (call , scheduleData );
97+ ? await scheduleStore .updateSchedule (schedules .value [0 ].id , scheduleData )
98+ : await scheduleStore .createSchedule (scheduleData );
10099
101100 if ((data as Error )?.error ) {
102101 errorMessage .value = {
@@ -107,7 +106,7 @@ const onSubmit = async () => {
107106 return ;
108107 }
109108
110- await nextStep (call );
109+ await ftueStore . nextStep ();
111110};
112111
113112onMounted (async () => {
@@ -118,8 +117,8 @@ onMounted(async () => {
118117 };
119118
120119 await Promise .all ([
121- calendarStore .fetch (call , true ),
122- scheduleStore .fetch (call , true ),
120+ calendarStore .fetch (true ),
121+ scheduleStore .fetch (true ),
123122 ]);
124123
125124 schedule .value .calendar = connectedCalendars .value [0 ].id ;
@@ -185,7 +184,7 @@ onMounted(async () => {
185184 :title =" t('label.back')"
186185 v-if =" hasPreviousStep"
187186 :disabled =" isLoading"
188- @click =" previousStep()"
187+ @click =" ftueStore. previousStep()"
189188 >
190189 {{ t('label.back') }}
191190 </secondary-button >
0 commit comments