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_SCHEDULE: "saveSchedule",
|
||||
SAVE_EMAIL: "saveEmail",
|
||||
SAVE_PHONE_NUMBER: "savePhoneNumber",
|
||||
SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup",
|
||||
SAVE_VIN: "saveVin",
|
||||
SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup",
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ const storeMutations = {
|
|||
|
||||
// CUSTOMER MUTATIONS
|
||||
UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress",
|
||||
UPDATE_CUSTOMER_PHONE_NUMBER: "updateCustomerPhoneNumber",
|
||||
UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails",
|
||||
|
||||
// ORDER MUTATIONS
|
||||
|
|
|
|||
|
|
@ -898,6 +898,10 @@ function updateExternalParameterState() {
|
|||
storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER,
|
||||
externalParameterPhoneNumber
|
||||
);
|
||||
store.commit(
|
||||
storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER,
|
||||
externalParameterPhoneNumber
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -343,6 +343,9 @@ export const mutations = {
|
|||
updateCustomerEmailAddress(state, customerEmailAddress) {
|
||||
state.order.customer.emailAddress = customerEmailAddress;
|
||||
},
|
||||
updateCustomerPhoneNumber(state, phoneNumber) {
|
||||
state.order.customer.phoneNumber = phoneNumber;
|
||||
},
|
||||
updateVehicle(state, vehicleInfo) {
|
||||
state.order.vehicle.year = vehicleInfo.year;
|
||||
state.order.vehicle.make = vehicleInfo.make;
|
||||
|
|
@ -3038,6 +3041,10 @@ export const actions = {
|
|||
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 }) {
|
||||
//Reset dependent state when changing
|
||||
if (vehicleInfo.vin !== context.state.order.vehicle.vin) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue