INSR-8549 Fixed some edge cases

Fixed logger not logging Error type correctly
This commit is contained in:
Josh Dassinger 2026-02-23 09:55:36 -06:00
parent edbd6b3e2d
commit dbb46c58e7
5 changed files with 40 additions and 28 deletions

View file

@ -32,9 +32,16 @@ export class Logger {
}
formatLogEntry(message, details) {
return `Application: ${applicationConfig.APPLICATION_NAME}\n${message}\n${
details ? JSON.stringify(details, undefined, 2) : ''
}`;
let json = '';
if (details) {
if (details instanceof Error) {
json = JSON.stringify(details, Object.getOwnPropertyNames(details), 2);
} else {
json = JSON.stringify(details, undefined, 2)
}
}
return `Application: ${applicationConfig.APPLICATION_NAME} \n${message} \n${json}`;
}
writeLogEntry(endpoint, logEntry) {

View file

@ -86,12 +86,12 @@ export async function onProviderChanged() {
{
resultKey: 'glassFees',
promise: mainStore.getGlassFees()
.then(async (glassFees) => await mainStore.getCombinedQuote(glassFees))
.then(async (glassFees) => await mainStore.getCombinedQuote(glassFees.data))
.then(async (quotedGlassFees) => mainStore.updateGlassFees(quotedGlassFees))
},
];
if (isMobileAppointment && (this.mainStore.isNoComp || this.mainStore.isITAC)) {
if (isMobileAppointment && (mainStore.isNoComp || mainStore.isITAC)) {
promiseResultMap.push({
resultKey: 'priceMobileFee',
promise: getPricedMobileFeePart(serviceZipCode).then(mobileFee => mainStore.updateMobileFee(mobileFee))

View file

@ -225,7 +225,7 @@ export default {
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
const { isMobileAppointment, storeSelectedProvider, serviceZipCode } = getProviderData();
const { isMobileAppointment, storeServiceLocation, storeSelectedProvider, serviceZipCode } = getProviderData();
const zipCodeData = getZipCodeData(serviceZipCode);
const serviceabilityDetailsPromise = useMainStore().getServiceabilityDetails(serviceZipCode);
const providersPromise = useMainStore().getSafeliteProviders(serviceZipCode, 150);
@ -647,7 +647,9 @@ export default {
}
},
mobileZipUpdatedFromServiceLocation(mobileZipServiceLocation) {
if (mobileZipServiceLocation) {
if (mobileZipServiceLocation
&& (this.mobileProviderNumber !== mobileZipServiceLocation.mobileProviderNumber
|| !this.hasNeededServiceLocationData)) {
this.mobileProviderNumber = mobileZipServiceLocation.mobileProviderNumber;
this.selectedMobileZipCode = mobileZipServiceLocation.zipCode;
this.selectedServiceLocation = mobileZipServiceLocation;
@ -659,11 +661,15 @@ export default {
},
async providerChangedFromServiceLocation(newProvider) {
this.selectedProvider = newProvider?.provider;
if (newProvider?.refreshDatePicker && newProvider.provider) {
showIssLoadingModal(true);
if (newProvider?.provider) {
this.mainStore.updateServiceLocation(newProvider);
showIssLoadingModal(true);
await onProviderChanged();
await this.refreshDatePicker();
if (newProvider.refreshDatePicker) {
await this.refreshDatePicker();
} else {
showIssLoadingModal(false);
}
}
},
async refreshDatePicker() {

View file

@ -88,7 +88,6 @@ import { useMainStore } from '@/store';
import {
getMobileZipCodeData,
getPricedMobileFeePart,
getServiceabilityDetails
} from '@/helpers/service-location-helper';
import { deepClone } from '@/helpers/object-helper.js';
import vehicleProtectedQuestion from '@/layouts/schedule-page/service-location/mobile-location-modal-question/vehicle-protected-question/vehicle-protected-question.vue';
@ -273,7 +272,7 @@ export default {
const mobileFeePart = await getPricedMobileFeePart(serviceZipCode);
// retrieve serviceability details
const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode);
const serviceabilityDetails = await useMainStore().getServiceabilityDetails(serviceZipCode);
// update content related to service zip code
this.$emit('updated-mobile-fee-part', mobileFeePart);

View file

@ -1340,7 +1340,7 @@ export const useMainStore = defineStore({
});
},
getServiceabilityDetails({ serviceZipCode }) {
getServiceabilityDetails(serviceZipCode) {
const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order;
const { carId } = vehicle;
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
@ -1842,26 +1842,26 @@ export const useMainStore = defineStore({
this.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu ?? this.order.serviceLocation.zipCodeCtu;
this.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType ?? this.order.serviceLocation.appointmentType;
this.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected ?? this.order.serviceLocation.isVehicleProtected;
if (serviceLocationInfo.provider) {
this.order.serviceLocation.provider = {
providerNumber: serviceLocationInfo.provider?.providerNumber,
address: {
streetAddress: serviceLocationInfo.provider?.address?.streetAddress,
city: serviceLocationInfo.provider?.address?.city,
state: serviceLocationInfo.provider?.address?.state,
zipCode: serviceLocationInfo.provider?.address?.zipCode,
zipCodeCtu: serviceLocationInfo.provider?.address?.zipCodeCtu
},
companyName: serviceLocationInfo.provider?.companyName,
phoneNumber: serviceLocationInfo.provider?.phoneNumber
};
}
this.updateServiceLocationProvider(serviceLocationInfo.provider)
this.order.serviceLocation.tpaSearchRadius = serviceLocationInfo.tpaSearchRadius;
},
updateAppointmentType(appointmentType) {
this.order.serviceLocation.appointmentType = appointmentType;
},
updateServiceLocationProvider(providerInfo) {
this.order.serviceLocation.provider = {
providerNumber: providerInfo?.providerNumber,
address: {
streetAddress: providerInfo?.address?.streetAddress,
city: providerInfo?.address?.city,
state: providerInfo?.address?.state,
zipCode: providerInfo?.address?.zipCode,
zipCodeCtu: providerInfo?.address?.zipCodeCtu
},
companyName: providerInfo?.companyName,
phoneNumber: providerInfo?.phoneNumber
};
},
resetState() {
Object.assign(this, getDefaultState());
},