Fix for CSR-1410
This commit is contained in:
parent
000b9a0b35
commit
41df561a67
4 changed files with 27 additions and 18 deletions
|
|
@ -381,18 +381,12 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
// If we already have a full address, show it
|
||||
console.log(this.showAddressFields);
|
||||
debugger; // eslint-disable-line no-debugger
|
||||
console.log(`this.addressModel.streetAddress ${this.addressModel.streetAddress}`);
|
||||
console.log(`this.addressModel.city ${this.addressModel.city}`);
|
||||
console.log(`this.addressModel.state ${this.addressModel.state}`);
|
||||
console.log(`this.addressModel.zipCode ${this.addressModel.zipCode}`);
|
||||
this.showAddressFields =
|
||||
this.addressModel.streetAddress !== "" &&
|
||||
this.addressModel.city !== "" &&
|
||||
this.addressModel.state !== "" &&
|
||||
this.addressModel.zipCode !== "";
|
||||
console.log(this.showAddressFields);
|
||||
(this.addressModel.streetAddress ?? "") !== "" &&
|
||||
(this.addressModel.city ?? "") !== "" &&
|
||||
(this.addressModel.state ?? "") !== "" &&
|
||||
(this.addressModel.zipCode ?? "") !== "";
|
||||
|
||||
if (!this.showAddressFields) {
|
||||
this.loadGooglePlacesAutocompleteScript();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,9 +305,14 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_SERVICE_LOCATION,
|
||||
{
|
||||
address: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
state: resultMap.serviceZipValidationResponse.state,
|
||||
zipCode: this.serviceZipCode,
|
||||
zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu,
|
||||
appointmentType: null,
|
||||
isVehicleProtected: null,
|
||||
},
|
||||
false
|
||||
);
|
||||
|
|
|
|||
|
|
@ -122,10 +122,10 @@ import { errorMessages } from "@/constants/error-messages";
|
|||
// DEFINE VALIDATION RULES
|
||||
defineRule("mobile-location-required", (value) => {
|
||||
if (
|
||||
value.addressQuestions.streetAddress == "" ||
|
||||
value.addressQuestions.city == "" ||
|
||||
value.addressQuestions.state == "" ||
|
||||
value.addressQuestions.zipCode == "" ||
|
||||
value.addressQuestions.streetAddress == null ||
|
||||
value.addressQuestions.city == null ||
|
||||
value.addressQuestions.state == null ||
|
||||
value.addressQuestions.zipCode == null ||
|
||||
value.isVehicleProtected == null
|
||||
) {
|
||||
return errorMessages.MOBILE_LOCATION_REQUIRED;
|
||||
|
|
@ -361,9 +361,9 @@ export default {
|
|||
return store.getters.order.serviceLocation.provider;
|
||||
},
|
||||
resetMobileLocation() {
|
||||
this.streetAddress = "";
|
||||
this.apartmentNumberOrBusinessName = "";
|
||||
this.city = "";
|
||||
this.streetAddress = null;
|
||||
this.apartmentNumberOrBusinessName = null;
|
||||
this.city = null;
|
||||
|
||||
this.isVehicleProtected = null;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -325,9 +325,14 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
|
||||
{
|
||||
address: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
state: resultMap.zipCodeData.state,
|
||||
zipCode: this.serviceZipCode,
|
||||
zipCodeCtu: resultMap.zipCodeData.zipCodeCtu,
|
||||
appointmentType: null,
|
||||
isVehicleProtected: null,
|
||||
},
|
||||
false
|
||||
);
|
||||
|
|
@ -362,9 +367,14 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
|
||||
{
|
||||
address: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
state: zipCodeData.state,
|
||||
zipCode: this.serviceZipCode,
|
||||
zipCodeCtu: zipCodeData.zipCodeCtu,
|
||||
appointmentType: null,
|
||||
isVehicleProtected: null,
|
||||
},
|
||||
false
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue