feat(medusa): Remove reservations for all line items when an order edit is accepted (#3544)
**What** - Remove all allocations to line items once an order edit is confirmed **Why** - Since all line items of an order are discarded once an order edit is confirmed it will orphan the reservations causing inconsistencies with the stock
This commit is contained in:
@@ -242,9 +242,10 @@ export default class ReservationItemService {
|
||||
context
|
||||
)
|
||||
|
||||
const ops: Promise<unknown>[] = []
|
||||
const ops: Promise<unknown>[] = [
|
||||
itemRepository.softDelete({ line_item_id: lineItemId })
|
||||
]
|
||||
for (const item of items) {
|
||||
ops.push(itemRepository.softRemove({ line_item_id: lineItemId }))
|
||||
ops.push(
|
||||
this.inventoryLevelService_.adjustReservedQuantity(
|
||||
item.inventory_item_id,
|
||||
|
||||
Reference in New Issue
Block a user