Skip to content

Commit

Permalink
fix(updateOrderDeadlines): do not assume that every orderItem must ha…
Browse files Browse the repository at this point in the history
…ve a customerItem, update everything that is not returned
  • Loading branch information
AdrianAndersen committed Jun 24, 2024
1 parent f3f1a2c commit 3e2e876
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,11 @@ export class OrderDetailCardComponent implements OnInit {
});
const customerItems = (
await Promise.allSettled(
this.order.orderItems
// We are only interested in updating the branch for active customer items
// We know that there are no active customer items if the order has no customerItem attached, or it was cancelled in this order
// Thus, no need to send excessive requests.
.filter((oi) => oi.customerItem && oi.type !== "cancel")
.map((orderItem) =>
this._customerItemService.get({
query: `?blid=${orderItem.blid}&returned=false&buyout=false&cancel=false`,
})
)
this.order.orderItems.map((orderItem) =>
this._customerItemService.get({
query: `?blid=${orderItem.blid}&returned=false&buyout=false&cancel=false`,
})
)
)
)
.filter(
Expand Down

0 comments on commit 3e2e876

Please sign in to comment.