Pārlūkot izejas kodu

fix(core): Send the correct amount to `refundOrder` (#2559)

Alexis Vigoureux 2 gadi atpakaļ
vecāks
revīzija
b5a265f93d

+ 5 - 2
packages/core/src/config/order/default-order-process.ts

@@ -413,10 +413,13 @@ export function configureDefaultOrderProcess(options: DefaultOrderProcessOptions
                     order.active = false;
                     order.orderPlacedAt = new Date();
                     await Promise.all(
-                        order.lines.map(line =>
+                        order.lines.map(line => {
+                            line.orderPlacedQuantity = line.quantity
                             connection
                                 .getRepository(ctx, OrderLine)
-                                .update(line.id, { orderPlacedQuantity: line.quantity }),
+                                .update(line.id, { orderPlacedQuantity: line.quantity })
+                            return line
+                        }
                         ),
                     );
                     eventBus.publish(new OrderPlacedEvent(fromState, toState, ctx, order));