diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index c1924d463..727bc03e4 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -106,7 +106,6 @@ { - if (shop.value.length > 5 && shop.value.startsWith("00")) { - return shop.value.substring(1); - } else { - return shop.value; - } - }); - var joinedShops = shops.join(","); - if (!joinedShops) { - joinedShops = "no-shops"; + var shops = mappedData.map((shop) => { + if (shop.value.length > 5 && shop.value.startsWith("00")) { + return shop.value.substring(1); + } else { + return shop.value; } + }); - this.pushEventToGA(this.GaCategories.SERVICE_LOCATION, gaAction, joinedShops, true); + var joinedShops = shops.join(","); + if (!joinedShops) { + joinedShops = "no-shops"; } + this.pushEventToGA(this.GaCategories.SERVICE_LOCATION, gaAction, joinedShops, true); + + if (this.answers.length === 0) { this.answers = mappedData; } else { @@ -353,22 +350,12 @@ export default { } this.localShopProviderData = result.data; this.updateShopsForZip(this.internalModel.zipCode); - if (this.appointmentType === AppointmentTypeStrings.MOBILE) { - this.selectedProvider = new Provider( - this.shopProviderData.mobileProviderNumber - ); - } else { - this.selectedProvider = new Provider(); - } + this.selectedProvider = new Provider(); }); } } }, updateShopsForZip(zipCode) { - if (!this.appointmentType) { - this.answers = []; - return; - } this.lastSearchedZip = zipCode; if (!zipCode) { this.answers = []; @@ -420,7 +407,9 @@ export default { availabilityRatingCallback: getAvailabilityRating, startDate: formattedStartDate, endDate: formattedEndDate, - shopAppointmentType: this.appointmentType, + // Used for availability indicators, could be refactored out of any availability indicator + // logic if/when we are sure we'll never have separate drop off/ in shop logic + shopAppointmentType: AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF, }, value: shopProvider.providerNumber, };