diff --git a/src/global-methods.js b/src/global-methods.js index f0675c02d..c0823f29a 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -30,6 +30,7 @@ export default { } }, (error) => { + console.error(error); return reject(error.response); } ); diff --git a/src/helpers/layout-helper.js b/src/helpers/layout-helper.js index 10f331faf..0a8177e25 100644 --- a/src/helpers/layout-helper.js +++ b/src/helpers/layout-helper.js @@ -15,10 +15,10 @@ export function settleAllPromises(promiseResultMap) { // when returned, so other promises do. Map the results to the object // so that the object is the return data. - if (results[i].value.data === undefined) { - resultMap[promiseName] = results[i].value; + if (results[i]?.value?.data === undefined) { + resultMap[promiseName] = results[i]?.value; } else { - resultMap[promiseName] = results[i].value.data; + resultMap[promiseName] = results[i]?.value?.data; } } diff --git a/src/store/index.js b/src/store/index.js index d7f00dca3..0fc7dec76 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -93,7 +93,7 @@ export const mutations = { updateVehicleVin(state, vin) { state.order.vehicle.vin = vin; }, - updateIsRepair(state, isRepair){ + updateIsRepair(state, isRepair) { state.order.damage.isRepair = isRepair; }, updateNumberOfChips(state, numberOfChips) { @@ -248,7 +248,7 @@ export const actions = { method: endpoints.LookupVinByPlate.method, endpoint: endpoints.LookupVinByPlate.url, payload: { - licensePlate: licensePlate, + licensePlate: licensePlate, licenseState: licenseState }, }); @@ -292,12 +292,12 @@ export const actions = { }, getDamageOptions(context, { carId }) { return globalMethods.callHttpClient({ - methods: endpoints.GetDamageOptions.method, + methods: endpoints.GetDamageOptions.method, endpoint: `${endpoints.GetDamageOptions.url}/${carId}`, payload: {}, }); }, - validateZip(context, {zip}) { + validateZip(context, { zip }) { return globalMethods.callHttpClient({ methods: endpoints.ValidateZip.method, endpoint: `${endpoints.ValidateZip.url}/${zip}` @@ -363,20 +363,20 @@ export const actions = { context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId); }, - logExperimentExposure(context, {userId, sessionKey, sessionId, pageName, serverName, pageEvent, universeName }){ - return globalMethods.callHttpClient({ - method: endpoints.LogExperimentExposureIfAssigned.method, - endpoint: endpoints.LogExperimentExposureIfAssigned.url, - payload: { - userId: userId, - sessionKey: sessionKey, - sessionId: sessionId, - pageName: pageName, - serverName: serverName, - pageEvent: pageEvent, - universeName: universeName - } - }) + logExperimentExposure(context, { userId, sessionKey, sessionId, pageName, serverName, pageEvent, universeName }) { + return globalMethods.callHttpClient({ + method: endpoints.LogExperimentExposureIfAssigned.method, + endpoint: endpoints.LogExperimentExposureIfAssigned.url, + payload: { + userId: userId, + sessionKey: sessionKey, + sessionId: sessionId, + pageName: pageName, + serverName: serverName, + pageEvent: pageEvent, + universeName: universeName + } + }); }, // Parts API Actions