Explorar o código

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

Alexis Vigoureux %!s(int64=2) %!d(string=hai) anos
pai
achega
b5a265f93d
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      packages/core/src/config/order/default-order-process.ts

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

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