Преглед на файлове

fix(core): Correctly save OrderLine shippingLineId

Michael Bromley преди 2 години
родител
ревизия
f703e063bc
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      packages/core/src/service/services/order.service.ts

+ 4 - 1
packages/core/src/service/services/order.service.ts

@@ -919,9 +919,12 @@ export class OrderService {
                 .update({ shippingLineId: shippingLine.id })
                 .update({ shippingLineId: shippingLine.id })
                 .whereInIds(orderLinesForShippingLine.map(l => l.id))
                 .whereInIds(orderLinesForShippingLine.map(l => l.id))
                 .execute();
                 .execute();
+            orderLinesForShippingLine.forEach(line => {
+                line.shippingLine = shippingLine;
+            });
         }
         }
         const updatedOrder = await this.getOrderOrThrow(ctx, orderId);
         const updatedOrder = await this.getOrderOrThrow(ctx, orderId);
-        await this.applyPriceAdjustments(ctx, updatedOrder);
+        await this.applyPriceAdjustments(ctx, order);
         return this.connection.getRepository(ctx, Order).save(order);
         return this.connection.getRepository(ctx, Order).save(order);
     }
     }