SSR-1385 Allow Repair NoComp to call ITAC pricing API
This commit is contained in:
parent
ae0da7749e
commit
e560191866
1 changed files with 15 additions and 24 deletions
|
|
@ -364,31 +364,22 @@ export default {
|
||||||
...(clonedGlassParts ?? [])
|
...(clonedGlassParts ?? [])
|
||||||
];
|
];
|
||||||
|
|
||||||
let pricingRequest;
|
// We only call the ITAC pricing endpoint if we are not repair or we are NoComp
|
||||||
if (!this.isRepair) {
|
if (!this.isRepair || this.mainStore.isNoComp) {
|
||||||
// If we are NOT a repair we call the ITAC pricing service
|
const pricingResults = useMainStore().getITACPriceOrderItems(availableLineItems)
|
||||||
pricingRequest = useMainStore().getITACPriceOrderItems(availableLineItems);
|
.catch((err) => {
|
||||||
} else if (this.mainStore.isNoComp) {
|
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
||||||
// If we are a repair and are NoComp we call the insurance pricing service.
|
availableLineItems.map((li) => li.partNumber),
|
||||||
pricingRequest = useMainStore().getInsurancePriceOrderItems(availableLineItems);
|
{
|
||||||
} else {
|
code: err.code,
|
||||||
// We don't price parts if we are repair and is Deductible
|
message: err.message,
|
||||||
return;
|
data: err.data
|
||||||
|
}
|
||||||
|
));
|
||||||
|
this.navigateWithScenario(navigationScenarios.PRICING_LOOKUP_ERROR);
|
||||||
|
});
|
||||||
|
this.setBaseServiceLineItems(pricingResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pricingResults = await pricingRequest.catch((err) => {
|
|
||||||
useMainStore().setBailout(bailoutMessage.pricingResponseError(
|
|
||||||
availableLineItems.map((li) => li.partNumber),
|
|
||||||
{
|
|
||||||
code: err.code,
|
|
||||||
message: err.message,
|
|
||||||
data: err.data
|
|
||||||
}
|
|
||||||
));
|
|
||||||
this.navigateWithScenario(navigationScenarios.PRICING_LOOKUP_ERROR);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setBaseServiceLineItems(pricingResults);
|
|
||||||
},
|
},
|
||||||
async navigateForward() {
|
async navigateForward() {
|
||||||
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
|
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue