skip final-deductible and register-claim call if vehicle is not on policy

This commit is contained in:
Katie Kroell 2023-12-04 15:47:18 -05:00
parent eab270d056
commit 5a77edcc86

View file

@ -170,7 +170,7 @@ export default {
];
let pricingResults = [];
if (useMainStore().order.policy.policyLookupSuccessful) {
if (useMainStore().order.policy.policyLookupSuccessful && useMainStore().order.vehicle.policyVehicleId) {
await useMainStore().getFinalDeductible();
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems);
}
@ -343,6 +343,7 @@ export default {
async initializeComponent() {
useMainStore().updatePolicyITACFlag(this.verifiedITAC);
if (this.policyLookupSuccessful
&& useMainStore().order.vehicle.policyVehicleId
&& useMainStore().isClaimRegistrationRequired
&& (this.coveredAndServicePriceAboveOrEqualDeductible || this.verifiedITAC)) {
await useMainStore().registerClaim()?.catch(() => {});