mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
committed by
Lorenz Hilpert
parent
8d26d94b9f
commit
c0dec7729c
@@ -50,13 +50,16 @@ export class CheckoutReviewComponent implements OnInit {
|
||||
map((items) =>
|
||||
items.reduce((grouped, item) => {
|
||||
// let index = grouped.findIndex((g) => g?.orderType === item?.features?.orderType && g.destination?.id === item?.destination?.id);
|
||||
let index = grouped.findIndex((g) => g?.orderType === item?.features?.orderType);
|
||||
let index = grouped.findIndex((g) => g?.orderType === 'Dummy' || g?.orderType === item?.features?.orderType);
|
||||
let group = index !== -1 ? grouped[index] : undefined;
|
||||
group = {
|
||||
orderType: item?.availability?.supplyChannel === 'MANUALLY' ? 'Dummy' : item.features.orderType,
|
||||
destination: item.destination?.data,
|
||||
items: [],
|
||||
};
|
||||
|
||||
if (!group) {
|
||||
group = {
|
||||
orderType: item?.availability?.supplyChannel === 'MANUALLY' ? 'Dummy' : item.features.orderType,
|
||||
destination: item.destination?.data,
|
||||
items: [],
|
||||
};
|
||||
}
|
||||
|
||||
group.items = [...group.items, item]?.sort((a, b) => a.destination?.data?.targetBranch?.id - b.destination?.data?.targetBranch?.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user