diff --git a/src/constants/progress-bar-mapper.js b/src/constants/progress-bar-mapper.js index c12bdf13..e80fbb5c 100644 --- a/src/constants/progress-bar-mapper.js +++ b/src/constants/progress-bar-mapper.js @@ -50,9 +50,6 @@ export const pageProgressMapper = { 'provider-preference': { percent: 60 }, - 'service-location': { - percent: 65 - }, 'schedule-page': { percent: 70 }, diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index bdd971cf..b785a171 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -153,6 +153,10 @@ import { selectableDaysOptions } from './mixins/helpers'; export default { name: 'date-picker', props: { + activeAppointmentType: { + type: String, + default: null + }, customComponentId: String, selectableDatesSetting: { type: String, @@ -161,6 +165,10 @@ export default { }, default: selectableDaysOptions.PAST }, + isMobileView: { + type: Boolean, + default: false + }, modelValue: { type: Object }, @@ -241,8 +249,7 @@ export default { daysLoaded: 0, appointmentDurationMinutesMinimum: 90, appointmentDurationMinutesMaximum: 120, - initialDaysToLoad: 15, - isMobileView: false + initialDaysToLoad: 15 }; }, computed: { @@ -284,6 +291,16 @@ export default { } }, watch: { + isMobileView(newValue, oldValue) { + if (newValue !== oldValue) { + this.activePageIndex = 0; + this.selectedDate = null; + this.selectedTimeOfDayGrouping = null; + this.selectedTime = null; + this.selectedTimeSlot = null; + this.findFirstAvailableDateInView(); + } + }, selectedTimeSlot(newValue, oldValue) { if (newValue !== oldValue) { const testObj = this.getSelectedTimeSlotInfoObject(newValue); @@ -296,20 +313,30 @@ export default { } } }, - mounted() { - this.mql = window.matchMedia('(min-width: 1200px)'); - this.isMobileView = !this.mql.matches; - this.mql.addEventListener('change', this.handleMqlChange); - }, - unmounted() { - if (this.mql) { - this.mql.removeEventListener('change', this.handleMqlChange); - } - }, methods: { initializeComponent(initialData) { + this.resetComponent(); this.setCalendarData(initialData); }, + resetComponent() { + this.isLoading = true; + this.selectableDatesData = []; // NOTE: uses monthNum (1-based), NOT monthIndex (0-based) + this.selectableTimeSlotsData = []; + this.selectedTimeOfDayGrouping = null; + this.selectedDate = null; + this.selectedTime = null; + this.selectedTimeSlot = null; + this.activeDate = new Date(); + this.activePageIndex = 0; + this.todaysDate = new Date(); + this.mql = null; + this.daysInViewMobile = 3; + this.daysInViewStandard = 5; + this.daysLoaded = 0; + this.appointmentDurationMinutesMinimum = 90; + this.appointmentDurationMinutesMaximum = 120; + this.initialDaysToLoad = 15; + }, addPremiumFlagToInput(routeCode) { return (`${routeCode}${PREMIUM_TIME_SLOT_ID_FLAG}`); }, @@ -352,17 +379,8 @@ export default { isPremiumAppointment: null }; }, - handleMqlChange(e) { - this.isMobileView = !e.matches; - this.activePageIndex = 0; - this.selectedDate = null; - this.selectedTimeOfDayGrouping = null; - this.selectedTime = null; - this.selectedTimeSlot = null; - this.findFirstAvailableDateInView(); - }, displayTimeSlotTime(timeSlot) { - const { appointmentType } = this.mainStore.order.serviceLocation; + const appointmentType = this.activeAppointmentType || AppointmentTypeStrings.IN_SHOP; if (appointmentType === AppointmentTypeStrings.MOBILE || appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) { return `${militaryToTwelveHourTime(timeSlot.startTime)} - ${militaryToTwelveHourTime(timeSlot.endTime)}`; } @@ -434,38 +452,6 @@ export default { const dateToShow = this.getDateToShow(index); return convertDateToDateString(dateToShow); }, - getEndDateForExistingDate(startDate, selectedDateString, daysInView) { - const endDate = new Date(startDate); - endDate.setDate(endDate.getDate() + (daysInView - 1)); - - if (selectedDateString) { - const selectedDate = new Date(`${selectedDateString}T00:00:00`); - const daysDifferenceComparedToStartDate = Math.ceil((selectedDate - startDate) / (1000 * 60 * 60 * 24)); - if (selectedDate > endDate) { - const daysDifferenceComparedToStartDateAsPages = Math.ceil(daysDifferenceComparedToStartDate / daysInView); - const newEndDate = new Date(startDate); - newEndDate.setDate(newEndDate.getDate() + (daysDifferenceComparedToStartDateAsPages * daysInView) - 1); - - return { - endDateString: convertDateToDateString(newEndDate), - newDaysLoaded: (daysDifferenceComparedToStartDateAsPages * daysInView), - daysFromStart: daysDifferenceComparedToStartDate - }; - } - - return { - endDateString: convertDateToDateString(endDate), - newDaysLoaded: null, - daysFromStart: daysDifferenceComparedToStartDate - }; - } - - return { - endDateString: convertDateToDateString(endDate), - newDaysLoaded: null, - daysFromStart: null - }; - }, async gotoNextPage() { const maxPageIndex = Math.floor((this.daysLoaded - 1) / this.daysToAdd); if (this.activePageIndex >= maxPageIndex) { @@ -572,66 +558,7 @@ export default { timeSlotInputChanged(timeSlot) { this.selectTimeSlotForDay(timeSlot); }, - async loadInitialData(config) { - /* - ** NOTE: this _could_ be called by a parent before fully loaded, so data or computeds might not be available - */ - let todayDateString; - const todayDateObject = new Date(); - const calendarViewDirection = 'future'; - const initialDays = 15; - - if (this.todayString) { - todayDateString = this.todayString; - } else if (config.todayOverrideDateString) { - todayDateString = config.todayOverrideDateString; - } else { - todayDateString = convertDateToDateString(todayDateObject); - } - - const initialViewStartDate = todayDateString; - const initialEndDate = new Date(); - initialEndDate.setDate(initialEndDate.getDate() + (initialDays - 1)); - let initialViewEndDate = convertDateToDateString(initialEndDate); - - const endDateObject = this.getEndDateForExistingDate( - todayDateObject, - config.preSelectedDate, - initialDays - ); - - if (endDateObject.endDateString !== initialViewEndDate) { - initialViewEndDate = endDateObject.endDateString; - } - - const loadInitialDataPromise = new Promise((resolve) => { - const response = config.customSelectableDatesCallback( - initialViewStartDate, - initialViewEndDate, - useMainStore().order.serviceLocation.appointmentType, - useMainStore().order.serviceLocation.provider.providerNumber - ); - resolve(response); - }); - - return loadInitialDataPromise.then((response) => { - const initialData = { - todayDate: todayDateString, - initialViewStartDate, - initialViewEndDate, - calendarViewDirection, - initialShopTimeSlotsResponse: response, - preSelectedDate: config.preSelectedDate, - initialDaysLoaded: endDateObject.newDaysLoaded || initialDays, - daysFromStart: endDateObject.daysFromStart || null - }; - - return initialData; - }); - }, async setCalendarData(config = {}) { - const initialMql = window.matchMedia('(min-width: 1200px)'); - this.isMobileView = !initialMql.matches; config.initialShopTimeSlotsResponse.days.forEach((selectableDate) => { const dateObjectToPush = { date: selectableDate.date, @@ -663,8 +590,11 @@ export default { this.findInitialDate(config.preSelectedDate, pageIndexObj.initialDayIndex); } else { this.findFirstAvailableDateInView(); - while (!this.selectedDate) { - this.gotoNextPage(); + let attempts = 0; + while (!this.selectedDate && attempts < 5) { + // eslint-disable-next-line no-await-in-loop + await this.gotoNextPage(); + attempts += 1; } } @@ -693,9 +623,7 @@ export default { const moreSelectableDates = await this.customSelectableDatesCallback( dateStart, - dateEnd, - this.mainStore.order.serviceLocation.appointmentType, - this.mainStore.order.serviceLocation.provider.providerNumber + dateEnd ); moreSelectableDates.days.forEach((selectableDate) => { @@ -899,7 +827,7 @@ export default { border-radius: $border-radius-list-button; box-shadow: 0 1px 5px 0 rgba(0, 0, 0, .2); color: #525656; - padding: 0.5rem 0; + padding: 0.625rem 0; margin-top: 0.625rem; text-align: center; cursor: pointer; diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index b5dd2e97..bc550684 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -306,6 +306,7 @@ function mapStringToState(str) { const valueFromStore = getStoreValueFromString(match[2]); if (!valueFromStore) { console.warn('Unable to resolve global state data.'); + console.warn(`Tried to resolve: ${match[2]}`); return ''; // if we can't map our string to state data, return an empty string. } const stringWithReplacement = str.replace(match[0], valueFromStore); diff --git a/src/layouts/schedule-page/location-alerts/location-alerts.vue b/src/layouts/schedule-page/location-alerts/location-alerts.vue index f47b3704..25232227 100644 --- a/src/layouts/schedule-page/location-alerts/location-alerts.vue +++ b/src/layouts/schedule-page/location-alerts/location-alerts.vue @@ -4,11 +4,14 @@ :key="alert.cmsWidgetName" :ref="alert.cmsWidgetName" class="mt-2 mb-3" + :manualHeadline="alert.manualHeadline" :cmsWidgetName="alert.cmsWidgetName" alertClass="alert-warning" /> diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/schedule-page/service-location/mobile-location-modal-question/mobile-location-modal-questions.vue similarity index 98% rename from src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue rename to src/layouts/schedule-page/service-location/mobile-location-modal-question/mobile-location-modal-questions.vue index 9647c322..a82fbc52 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/schedule-page/service-location/mobile-location-modal-question/mobile-location-modal-questions.vue @@ -79,8 +79,6 @@ import modal from '@/digital-components/modal/modal.vue'; import alert from '@/ux-components/alert/alert.vue'; import { useField } from 'vee-validate'; import addressQuestions from '@/iss-components/address-questions/address-questions.vue'; -// eslint-disable-next-line max-len -import vehicleProtectedQuestion from '@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue'; // Constants import { experimentSettings } from '@/constants/experiments'; @@ -90,10 +88,11 @@ import { useMainStore } from '@/store'; import { getMobileZipCodeData, getPricedMobileFeePart, - getServiceabilityDetails, - getZipCodeData + getServiceabilityDetails } from '@/helpers/service-location-helper'; import { deepClone } from '@/helpers/object-helper.js'; +// eslint-disable-next-line max-len +import vehicleProtectedQuestion from '@/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue'; export default { name: 'mobile-location-modal-questions', diff --git a/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue b/src/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue similarity index 100% rename from src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue rename to src/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/schedule-page/service-location/service-location.spec.js similarity index 78% rename from src/layouts/service-location/service-location.spec.js rename to src/layouts/schedule-page/service-location/service-location.spec.js index a09c0542..20e0596b 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/schedule-page/service-location/service-location.spec.js @@ -1,13 +1,12 @@ /* eslint-env jest */ import baseMixin from '@/mixins/base-mixin'; -import { mount, flushPromises } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import { createTestingPinia } from '@pinia/testing'; import { AppointmentTypeStrings } from '@/constants/schedule-constants'; import navigationScenarios from '@/router/router-constants/navigation-scenarios'; import routerParams from '@/router/router-constants/router-params'; import { useMainStore } from '@/store'; -import serviceLocation from '@/layouts/service-location/service-location.vue'; -import { getZipCodeData } from '@/helpers/service-location-helper'; +import serviceLocation from '@/layouts/schedule-page/service-location/service-location.vue'; const mockGetServiceabilityDetails = () => { const serviceabilityDetails = { @@ -50,43 +49,41 @@ const mockZipcodeData = (zip) => { state: null, zipCodeCtu: null }); -} -const mockProviders = () => { - return Promise.resolve([ - { - "address": { - "city": "COLUMBUS", - "country": "US", - "state": "OH", - "streetAddress": "6826 Sawmill Rd", - "streetAddress2": "", - "zipCode": "43235", - "zipCodeCtu": "03357" - }, - "distanceInMiles": 4.136335989015438, - "providerNumber": "003357", - "companyName": "SAFELITE AUTOGLASS - COLUMBUS, OH", - "phoneNumber": "6142336400", - "isSafeliteShop": true +}; +const mockProviders = () => Promise.resolve([ + { + address: { + city: 'COLUMBUS', + country: 'US', + state: 'OH', + streetAddress: '6826 Sawmill Rd', + streetAddress2: '', + zipCode: '43235', + zipCodeCtu: '03357' }, - { - "address": { - "city": "Lewis Center", - "country": "US", - "state": "OH", - "streetAddress": "1343 Cameron Ave", - "streetAddress2": "", - "zipCode": "43035", - "zipCodeCtu": "03357" - }, - "distanceInMiles": 8.193072412262042, - "providerNumber": "003417", - "companyName": "SAFELITE AUTOGLASS - LEWIS CENTER, OH", - "phoneNumber": "6147815433", - "isSafeliteShop": true - } - ]) -} + distanceInMiles: 4.136335989015438, + providerNumber: '003357', + companyName: 'SAFELITE AUTOGLASS - COLUMBUS, OH', + phoneNumber: '6142336400', + isSafeliteShop: true + }, + { + address: { + city: 'Lewis Center', + country: 'US', + state: 'OH', + streetAddress: '1343 Cameron Ave', + streetAddress2: '', + zipCode: '43035', + zipCodeCtu: '03357' + }, + distanceInMiles: 8.193072412262042, + providerNumber: '003417', + companyName: 'SAFELITE AUTOGLASS - LEWIS CENTER, OH', + phoneNumber: '6147815433', + isSafeliteShop: true + } +]); jest.mock( '@/helpers/service-location-helper', () => ({ @@ -138,13 +135,13 @@ const mountOptions = { } } }; -function setupMocks({ appointmentType = AppointmentTypeStrings.IN_SHOP }) { +function setupMocks({ appointmentType = AppointmentTypeStrings.IN_SHOP }) { mountOptions.global.plugins = [createTestingPinia({ initialState: { main: { order: { serviceLocation: { - appointmentType: appointmentType + appointmentType } } } @@ -204,7 +201,7 @@ describe('service-location.vue', () => { expect(wrapper.vm.zipContainsMilitaryBase).toBe(false); - const newMobileServiceZipCode = '45433' + const newMobileServiceZipCode = '45433'; // Act mobileServiceZipCodeQuestion.vm.$emit('update:modelValue', newMobileServiceZipCode); diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue new file mode 100644 index 00000000..92312f35 --- /dev/null +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -0,0 +1,581 @@ + + + + diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js b/src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.spec.js similarity index 97% rename from src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js rename to src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.spec.js index 8029dc06..66efbc1c 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js +++ b/src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.spec.js @@ -1,6 +1,6 @@ import { mount } from '@vue/test-utils'; import crypto from 'crypto'; -import serviceZipModalQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue'; +import serviceZipModalQuestion from '@/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.vue'; global.crypto = crypto; diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.vue similarity index 80% rename from src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue rename to src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.vue index 71558cab..5227af29 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue +++ b/src/layouts/schedule-page/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -35,7 +35,7 @@ diff --git a/src/mixins/vehicle-questions-mixin.spec.js b/src/mixins/vehicle-questions-mixin.spec.js index caa4fac6..87263a18 100644 --- a/src/mixins/vehicle-questions-mixin.spec.js +++ b/src/mixins/vehicle-questions-mixin.spec.js @@ -354,7 +354,7 @@ describe('vehicle-questions-mixin', () => { const testCases = [ [issPageValues.PART_QUESTIONS, issPageValues.VEHICLE_PARTS, false], [issPageValues.VEHICLE_PARTS, issPageValues.VEHICLE_PARTS, false], - [issPageValues.VEHICLE_PARTS, issPageValues.SERVICE_LOCATION, true], + [issPageValues.VEHICLE_PARTS, issPageValues.SCHEDULE_PAGE, true], [issPageValues.VEHICLE_PARTS, issPageValues.PART_QUESTIONS, true], [issPageValues.PART_QUESTIONS, issPageValues.CAPABILITY_QUESTIONS, false], [issPageValues.MOLDING_QUESTIONS, issPageValues.CAPABILITY_QUESTIONS, false] diff --git a/src/router/router-constants/issPage-values.js b/src/router/router-constants/issPage-values.js index b44a9a9d..c683e971 100644 --- a/src/router/router-constants/issPage-values.js +++ b/src/router/router-constants/issPage-values.js @@ -23,7 +23,6 @@ const issPageValues = Object.freeze({ POLICY_HOLDER_DETAILS: 'policy-holder-details', PROVIDER_PREFERENCE: 'provider-preference', REVEAL: 'reveal', - SERVICE_LOCATION: 'service-location', TPA_CONFIRMATION: 'tpa-confirmation', SERVICE_PACKAGES: 'service-packages', SCHEDULE_PAGE: 'schedule-page', diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 9e86b8cf..24a0ffb9 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -64,7 +64,8 @@ const navigationScenarios = Object.freeze({ CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS: 'CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS', // Schedule - CLICKED_CHANGE_LOCATION: 'CLICKED_CHANGE_LOCATION', + CLICKED_BACK_CANNOT_REACH_TPA_FLOW: 'CLICKED_BACK_CANNOT_REACH_TPA_FLOW', + CLICKED_BACK_CAN_REACH_TPA_FLOW: 'CLICKED_BACK_CAN_REACH_TPA_FLOW', // Coverage Statement CLICKED_BACK_WITH_REPAIR: 'CLICKED_BACK_WITH_REPAIR', @@ -83,10 +84,6 @@ const navigationScenarios = Object.freeze({ EDIT_PREFERRED_SHOP: 'EDIT_PREFERRED_SHOP', EDIT_CONTACT_DETAILS: 'EDIT_CONTACT_DETAILS', - // Service location - CLICKED_BACK_CANNOT_REACH_TPA_FLOW: 'CLICKED_BACK_CANNOT_REACH_TPA_FLOW', - CLICKED_BACK_CAN_REACH_TPA_FLOW: 'CLICKED_BACK_CAN_REACH_TPA_FLOW', - // Provider Preference CLICKED_FORWARD_WITH_SAFELITE: 'CLICKED_FORWARD_WITH_SAFELITE', CLICKED_FORWARD_WITH_TPA_ENABLED: 'CLICKED_FORWARD_WITH_TPA_ENABLED', diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index c526dc47..a23699d8 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -534,7 +534,7 @@ const routingTable = () => [ }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, - destinationIssPageValue: issPageValues.SERVICE_LOCATION + destinationIssPageValue: issPageValues.SCHEDULE_PAGE }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP, @@ -559,7 +559,7 @@ const routingTable = () => [ }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, - destinationIssPageValue: issPageValues.SERVICE_LOCATION + destinationIssPageValue: issPageValues.SCHEDULE_PAGE }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED, @@ -572,7 +572,7 @@ const routingTable = () => [ ] }, { - issPageValue: issPageValues.SERVICE_LOCATION, + issPageValue: issPageValues.SCHEDULE_PAGE, maps: [ { scenario: navigationScenarios.CLICKED_BACK_CANNOT_REACH_TPA_FLOW, @@ -582,26 +582,9 @@ const routingTable = () => [ scenario: navigationScenarios.CLICKED_BACK_CAN_REACH_TPA_FLOW, destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE }, - { - scenario: navigationScenarios.CLICKED_FORWARD, - destinationIssPageValue: issPageValues.SCHEDULE_PAGE - } - ] - }, - { - issPageValue: issPageValues.SCHEDULE_PAGE, - maps: [ - { - scenario: navigationScenarios.CLICKED_BACK, - destinationIssPageValue: issPageValues.SERVICE_LOCATION - }, { scenario: navigationScenarios.CLICKED_FORWARD, destinationIssPageValue: issPageValues.CONTACT_DETAILS - }, - { - scenario: navigationScenarios.CLICKED_CHANGE_LOCATION, - destinationIssPageValue: issPageValues.SERVICE_LOCATION } ] }, @@ -750,7 +733,7 @@ const routingTable = () => [ }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP, - destinationIssPageValue: issPageValues.SERVICE_LOCATION + destinationIssPageValue: issPageValues.SCHEDULE_PAGE }, { scenario: navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP, diff --git a/src/store/index.js b/src/store/index.js index 66d49aa0..a29104a6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -885,7 +885,7 @@ export const useMainStore = defineStore({ logApiCall: true }); }, - getMobileTimeSlots(startDate, endDate) { + getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) { const { order } = this; const { vehicle } = this.order; let lineItems = [ @@ -931,8 +931,9 @@ export const useMainStore = defineStore({ style: vehicle.style, vin: vehicle.vin ?? '' }, - zipCode: order.serviceLocation.zipCode + zipCode: zipCodeOverride ?? order.serviceLocation.zipCode }; + return globalMethods.callHttpClient({ method: endpoints.GetMobileTimeSlots.method, endpoint: endpoints.GetMobileTimeSlots.url, @@ -941,7 +942,7 @@ export const useMainStore = defineStore({ additionalSuccessEventDataHandler: (response) => getTimeSlotsAdditionalEventData( response.data.provisionalTriggers, - order.serviceLocation.zipCode, + zipCodeOverride ?? order.serviceLocation.zipCode, response.data.days?.[0]?.date ) }); @@ -2734,19 +2735,6 @@ export const useMainStore = defineStore({ }, saveServiceLocation(serviceLocationInfo) { - if (this.order.serviceLocation) { - if ( - serviceLocationInfo.zipCode !== this.order.serviceLocation.zipCode - || !providersEqual( - serviceLocationInfo.provider, - this.order.serviceLocation.provider - ) - || serviceLocationInfo.appointmentType - !== this.order.serviceLocation.appointmentType - ) { - this.resetSchedule(); - } - } this.updateServiceLocation(serviceLocationInfo); },