diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 2064f4880..e1cb33e14 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -79,6 +79,7 @@ const storeActions = { SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", SAVE_SUPPORTING_ITEMS: "saveSupportingItems", + SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION: "saveSupportingItemsAndResetServiceLocation", SAVE_VAPS: "saveVaps", }; diff --git a/src/layouts/service-location/helpers/object-helper/object-helper.js b/src/helpers/object-helper.js similarity index 100% rename from src/layouts/service-location/helpers/object-helper/object-helper.js rename to src/helpers/object-helper.js diff --git a/src/layouts/service-location/helpers/object-helper/object-helper.spec.js b/src/helpers/object-helper.spec.js similarity index 100% rename from src/layouts/service-location/helpers/object-helper/object-helper.spec.js rename to src/helpers/object-helper.spec.js diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 1ca0c9d48..404caff1d 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -272,7 +272,7 @@ export default { const resultMap = await settleAllPromises(promiseResultMap); this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, + this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION, resultMap.supportingItems, false ); diff --git a/src/layouts/molding-questions/molding-questions.spec.js b/src/layouts/molding-questions/molding-questions.spec.js index 9366540f6..9c003e748 100644 --- a/src/layouts/molding-questions/molding-questions.spec.js +++ b/src/layouts/molding-questions/molding-questions.spec.js @@ -109,7 +109,6 @@ store.getters = { damage: baseStoreGettersDamage, order: {}, }; -//store.commit = jest.fn(); store.dispatch = jest.fn(); afterEach(() => { diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 1e78647dc..4a28151f3 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -207,7 +207,7 @@ export default { } this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, + this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION, this.supportingItems, false ); diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index e65734053..0052c1368 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -66,7 +66,7 @@ import addressQuestions from "@/layouts/address-lookup/customer-questions/addres import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question"; // Helpers -import { deepClone } from "@/layouts/service-location/helpers/object-helper/object-helper"; +import { deepClone } from "@/helpers/object-helper"; import { getPricedMobileFeePart, getServiceabilityDetails, diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 5e2ec0c71..2e46c6f96 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -330,7 +330,7 @@ export default { storeActions.GET_SUPPORTING_ITEMS ); this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, + this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION, supportingItems.data, false ); diff --git a/src/store/index.js b/src/store/index.js index 570f884b5..ee6e40450 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,7 +10,7 @@ import { experimentTriggers } from "@/constants/experiments"; import { damageLocationsSelected } from "@/constants/damage-locations-selected"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js"; -import { deepEqual } from "@/layouts/service-location/helpers/object-helper/object-helper.js"; +import { deepEqual } from "@/helpers/object-helper"; import { AppointmentTypeStrings, PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants"; // Export State @@ -1776,6 +1776,10 @@ export const actions = { }, saveSupportingItems(context, supportingItems) { + context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems); + }, + + saveSupportingItemsAndResetServiceLocation(context, supportingItems) { if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) { context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE); context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);