CASH-97
CASH-97 use a store action/mutation to persist phone number in vuex.
This commit is contained in:
parent
5c8999899c
commit
19f775c463
4 changed files with 13 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ const storeActions = {
|
||||||
SAVE_SERVICE_LOCATION: "saveServiceLocation",
|
SAVE_SERVICE_LOCATION: "saveServiceLocation",
|
||||||
SAVE_SCHEDULE: "saveSchedule",
|
SAVE_SCHEDULE: "saveSchedule",
|
||||||
SAVE_EMAIL: "saveEmail",
|
SAVE_EMAIL: "saveEmail",
|
||||||
|
SAVE_PHONE_NUMBER: "savePhoneNumber",
|
||||||
SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup",
|
SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup",
|
||||||
SAVE_VIN: "saveVin",
|
SAVE_VIN: "saveVin",
|
||||||
SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup",
|
SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup",
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ const storeMutations = {
|
||||||
|
|
||||||
// CUSTOMER MUTATIONS
|
// CUSTOMER MUTATIONS
|
||||||
UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress",
|
UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress",
|
||||||
|
UPDATE_CUSTOMER_PHONE_NUMBER: "updateCustomerPhoneNumber",
|
||||||
UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails",
|
UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails",
|
||||||
|
|
||||||
// ORDER MUTATIONS
|
// ORDER MUTATIONS
|
||||||
|
|
|
||||||
|
|
@ -898,6 +898,10 @@ function updateExternalParameterState() {
|
||||||
storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER,
|
storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER,
|
||||||
externalParameterPhoneNumber
|
externalParameterPhoneNumber
|
||||||
);
|
);
|
||||||
|
store.commit(
|
||||||
|
storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER,
|
||||||
|
externalParameterPhoneNumber
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,9 @@ export const mutations = {
|
||||||
updateCustomerEmailAddress(state, customerEmailAddress) {
|
updateCustomerEmailAddress(state, customerEmailAddress) {
|
||||||
state.order.customer.emailAddress = customerEmailAddress;
|
state.order.customer.emailAddress = customerEmailAddress;
|
||||||
},
|
},
|
||||||
|
updateCustomerPhoneNumber(state, phoneNumber) {
|
||||||
|
state.order.customer.phoneNumber = phoneNumber;
|
||||||
|
},
|
||||||
updateVehicle(state, vehicleInfo) {
|
updateVehicle(state, vehicleInfo) {
|
||||||
state.order.vehicle.year = vehicleInfo.year;
|
state.order.vehicle.year = vehicleInfo.year;
|
||||||
state.order.vehicle.make = vehicleInfo.make;
|
state.order.vehicle.make = vehicleInfo.make;
|
||||||
|
|
@ -3038,6 +3041,10 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, email === "" ? null : email);
|
context.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, email === "" ? null : email);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
savePhoneNumber(context, phoneNumber) {
|
||||||
|
context.commit(storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, phoneNumber === "" ? null : phoneNumber);
|
||||||
|
},
|
||||||
|
|
||||||
saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) {
|
saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) {
|
||||||
//Reset dependent state when changing
|
//Reset dependent state when changing
|
||||||
if (vehicleInfo.vin !== context.state.order.vehicle.vin) {
|
if (vehicleInfo.vin !== context.state.order.vehicle.vin) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue