set mobile ctu
This commit is contained in:
CarlNation 2024-01-04 16:08:37 -05:00
parent dbc2974304
commit d7843ec8f0
2 changed files with 16 additions and 15 deletions

View file

@ -480,19 +480,6 @@ export default {
async forwardButtonAction() { async forwardButtonAction() {
this.navigatingForward = true; 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 ( if (
this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && this.selectedAppointmentType == AppointmentTypeStrings.MOBILE &&
this.selectedProvider && this.selectedProvider &&
@ -505,6 +492,19 @@ export default {
this.selectedProvider.address.zipCodeCtu = null; 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( await this.dispatchStoreAction(
this.storeActions.SAVE_SERVICE_LOCATION, this.storeActions.SAVE_SERVICE_LOCATION,
{ {
@ -513,7 +513,7 @@ export default {
city: this.city, city: this.city,
state: this.state, state: this.state,
zipCode: this.zipCode, zipCode: this.zipCode,
zipCodeCtu: this.zipCodeCtu, zipCodeCtu: ctu,
appointmentType: this.selectedAppointmentType, appointmentType: this.selectedAppointmentType,
isVehicleProtected: this.isVehicleProtected, isVehicleProtected: this.isVehicleProtected,
provider: { provider: {

View file

@ -911,9 +911,10 @@ export const actions = {
}, },
validateZip(context, { payload: { zip }, pageNameToLog }) { validateZip(context, { payload: { zip }, pageNameToLog }) {
const damageType = context.getters.damage.isRepair ? "Repair" : "Replace";
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
methods: endpoints.ValidateZip.method, methods: endpoints.ValidateZip.method,
endpoint: `${endpoints.ValidateZip.url}/${zip}`, endpoint: `${endpoints.ValidateZip.url}/${zip}/${damageType}`,
logApiCall: true, logApiCall: true,
pageNameToLog: pageNameToLog, pageNameToLog: pageNameToLog,
}); });