CASH-2397: bug fix if mobile api returns 200 but empty

This commit is contained in:
Adam Caouette 2026-02-18 17:04:24 -05:00
parent cbdbc241b6
commit f6f350afb1

View file

@ -28,7 +28,6 @@
cmsWidgetName="ScheduleYourServiceWidget"
id="schedule-your-service" />
<appointmentTypeQuestion
v-if="hasSelectableDatesLoaded"
v-model="appointmentTypeFromAppointmentTypeQuestion"
v-show="isAppointmentTypeDisplayed"
:isServiceableMobile="isServiceableMobile"
@ -36,7 +35,6 @@
:isDisplayed="isAppointmentTypeDisplayed"
:mobileFeeApplies="mobileFeeApplies"
:zipCode="zipCode"
ref="appointmentTypeQuestion"
groupName="appointmentTypeQuestion"
cmsWidgetName="AppointmentTypeQuestionWidget"
validationRules="option-required"
@ -950,7 +948,7 @@ export default {
return false;
},
hasSelectableDatesLoaded() {
if (this.isMobileSelected) {
if (this.isServiceableMobile) {
return this.selectableDatesMobile?.days?.length > 0;
} else {
return this.selectableDatesInshop?.days?.length > 0;
@ -1842,10 +1840,12 @@ export default {
} else {
this.appointmentType = null;
}
this.setSelectedDateToFirstAvailable(); // v-if on appointmentTypeQuestion ensures dates have been loaded by now
this.setSelectedDateToFirstAvailable();
},
setSelectedDateToFirstAvailable() {
this.selectedDate = this.getFirstAvailableDate();
if (this.hasSelectableDatesLoaded) { // ensure dates have been loaded by now
this.selectedDate = this.getFirstAvailableDate();
}
},
showRecalAcknowledgementModal() {
if (this.shouldShowRecalAckModal()) {
@ -2069,7 +2069,7 @@ export default {
watch: {
appointmentTypeFromAppointmentTypeQuestion: {
handler(newValue, oldValue) {
this.handleAppointmentTypeChange(newValue); // v-if on appointmentTypeQuestion ensures dates have been loaded by now
this.handleAppointmentTypeChange(newValue);
},
},
},