commit
2252610d37
3 changed files with 20 additions and 15 deletions
|
|
@ -480,19 +480,6 @@ export default {
|
|||
async forwardButtonAction() {
|
||||
this.navigatingForward = true;
|
||||
|
||||
// clear items not needed for appointmentType
|
||||
if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) {
|
||||
// if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they
|
||||
// may have selected a shop in a different ctu. change the servicelocation zip/ctu if different
|
||||
if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) {
|
||||
this.zipCodeCtu = this.selectedProvider.address.zipCodeCtu;
|
||||
this.zipCode = this.selectedProvider.address.zipCode;
|
||||
}
|
||||
|
||||
this.city = null;
|
||||
this.streetAddress = null;
|
||||
}
|
||||
|
||||
if (
|
||||
this.selectedAppointmentType == AppointmentTypeStrings.MOBILE &&
|
||||
this.selectedProvider &&
|
||||
|
|
@ -505,6 +492,18 @@ export default {
|
|||
this.selectedProvider.address.zipCodeCtu = null;
|
||||
}
|
||||
|
||||
var ctu = this.zipCodeCtu;
|
||||
if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) {
|
||||
// if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they
|
||||
// may have selected a shop in a different ctu. change the servicelocation zip/ctu if different
|
||||
if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) {
|
||||
ctu = this.selectedProvider.address.zipCodeCtu;
|
||||
}
|
||||
|
||||
this.city = null;
|
||||
this.streetAddress = null;
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SERVICE_LOCATION,
|
||||
{
|
||||
|
|
@ -513,7 +512,7 @@ export default {
|
|||
city: this.city,
|
||||
state: this.state,
|
||||
zipCode: this.zipCode,
|
||||
zipCodeCtu: this.zipCodeCtu,
|
||||
zipCodeCtu: ctu,
|
||||
appointmentType: this.selectedAppointmentType,
|
||||
isVehicleProtected: this.isVehicleProtected,
|
||||
provider: {
|
||||
|
|
|
|||
|
|
@ -911,9 +911,10 @@ export const actions = {
|
|||
},
|
||||
|
||||
validateZip(context, { payload: { zip }, pageNameToLog }) {
|
||||
const damageType = context.getters.damage.isRepair ? "Repair" : "Replace";
|
||||
return globalMethods.callHttpClient({
|
||||
methods: endpoints.ValidateZip.method,
|
||||
endpoint: `${endpoints.ValidateZip.url}/${zip}`,
|
||||
endpoint: `${endpoints.ValidateZip.url}/${zip}/${damageType}`,
|
||||
logApiCall: true,
|
||||
pageNameToLog: pageNameToLog,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -571,6 +571,11 @@ describe("Actions", () => {
|
|||
it("validateZip action", async () => {
|
||||
// Arrange
|
||||
const context = state;
|
||||
context.getters = {
|
||||
damage: {
|
||||
isRepair: "false",
|
||||
},
|
||||
};
|
||||
|
||||
// Act
|
||||
globalMethods.callHttpClient.mockImplementation(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue