Small other changes

This commit is contained in:
FrankRua 2022-04-14 11:08:57 -04:00
parent 650fbd564e
commit cfc3975684
3 changed files with 22 additions and 21 deletions

View file

@ -30,6 +30,7 @@ export default {
}
},
(error) => {
console.error(error);
return reject(error.response);
}
);

View file

@ -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;
}
}

View file

@ -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