CSR-1384: update store method to avoid mutating original lineItems array
This commit is contained in:
parent
575978ae65
commit
4c8e81d38d
1 changed files with 4 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper
|
|||
import { deepEqual } from "@/helpers/object-helper";
|
||||
import { AppointmentTypeStrings, PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
|
||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||
import { deepClone } from "@/helpers/object-helper";
|
||||
import { queryStrings } from "@/constants/query-strings";
|
||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||
import {
|
||||
|
|
@ -2274,7 +2275,8 @@ function convertGlassPieceNamingFromApi(glassArray) {
|
|||
}
|
||||
|
||||
function addPricesToLineItems(lineItems, pricingLineItems) {
|
||||
lineItems.forEach((lineItem) => {
|
||||
const pricedLineItems = deepClone(lineItems);
|
||||
pricedLineItems.forEach((lineItem) => {
|
||||
let lineItemIndex = pricingLineItems.findIndex(
|
||||
(pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber
|
||||
);
|
||||
|
|
@ -2286,7 +2288,7 @@ function addPricesToLineItems(lineItems, pricingLineItems) {
|
|||
lineItem.sellingPrice = pricedLineItem.sellingPrice;
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice;
|
||||
});
|
||||
return lineItems;
|
||||
return pricedLineItems;
|
||||
}
|
||||
|
||||
function getFlattenedArrayOfLineItemsWithChildParts(lineItems) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue