Revert "Merge pull request #2911 from Safelite/feature/CASH-1713"
This reverts commit71c7625631, reversing changes made to9ffd1ec2be.
This commit is contained in:
parent
71c7625631
commit
b5933955d9
1 changed files with 1 additions and 19 deletions
|
|
@ -174,23 +174,6 @@ import { Field } from "vee-validate";
|
||||||
defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED));
|
defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED));
|
||||||
|
|
||||||
function getFlattenedArrayOfLineItemsWithChildParts(lineItems, childPartRecursiveCall = false) {
|
|
||||||
let flattenedArray = [];
|
|
||||||
lineItems?.forEach((lineItem) => {
|
|
||||||
// this assumes childparts will never be a glass part
|
|
||||||
lineItem.isChildPart = childPartRecursiveCall;
|
|
||||||
flattenedArray.push(lineItem);
|
|
||||||
if (lineItem.childParts) {
|
|
||||||
flattenedArray = [
|
|
||||||
...flattenedArray,
|
|
||||||
...getFlattenedArrayOfLineItemsWithChildParts(lineItem.childParts, true),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return flattenedArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "paymentMethod",
|
name: "paymentMethod",
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -250,7 +233,7 @@ export default {
|
||||||
// Price everything again to ensure that serverData has all values
|
// Price everything again to ensure that serverData has all values
|
||||||
// Specifically this addresses an error where insurance client glass parts are not in serverData
|
// Specifically this addresses an error where insurance client glass parts are not in serverData
|
||||||
// See CASH-1713 for details
|
// See CASH-1713 for details
|
||||||
let pricedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const pricedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
{
|
{
|
||||||
availableLineItems: lineItemsOnOrderAndAvailableVaps,
|
availableLineItems: lineItemsOnOrderAndAvailableVaps,
|
||||||
|
|
@ -258,7 +241,6 @@ export default {
|
||||||
"payment-method",
|
"payment-method",
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
pricedLineItems = getFlattenedArrayOfLineItemsWithChildParts(pricedLineItems);
|
|
||||||
|
|
||||||
// Add prices to the availableVaps
|
// Add prices to the availableVaps
|
||||||
const pricedAvailableVaps = addPricesToLineItems(availableVaps, pricedLineItems);
|
const pricedAvailableVaps = addPricesToLineItems(availableVaps, pricedLineItems);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue