CSR-2243
Not actually related to CSR-2243 but found while debugging that issue. We set isGlassPart true for all items in that collection, even child parts like recal, molding and clips. Micro service team's latest changes is more strict with this property and returning a 404 error and then mule returns a 500 internal server error.
This commit is contained in:
parent
645d1b44a0
commit
ca4f6a2bd6
1 changed files with 5 additions and 7 deletions
|
|
@ -3201,14 +3201,16 @@ export function getArrayOfAllLineItemsAndChildParts(lineItems) {
|
|||
return consolidatedLineItemsArray;
|
||||
}
|
||||
|
||||
function getFlattenedArrayOfLineItemsWithChildParts(lineItems) {
|
||||
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),
|
||||
...getFlattenedArrayOfLineItemsWithChildParts(lineItem.childParts, true),
|
||||
];
|
||||
}
|
||||
});
|
||||
|
|
@ -3231,11 +3233,7 @@ function getFlattenedLineItemsWithGlassPartTag(lineItems) {
|
|||
return {
|
||||
partNumber: lineItem.partNumber,
|
||||
partType: lineItem.partType,
|
||||
isGlassPart:
|
||||
lineItem.partType == partTypeStrings.RECALIBRATION ||
|
||||
lineItem.partType == partTypeStrings.ADAS_RECALIBRATION
|
||||
? false
|
||||
: true,
|
||||
isGlassPart: lineItem.isChildPart ? false : true,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue