|
|
@@ -39,7 +39,13 @@ export class OrderSplitter {
|
|
|
}
|
|
|
const shippingLines: ShippingLine[] = [];
|
|
|
for (const shippingLine of partialOrder.shippingLines) {
|
|
|
- shippingLines.push(await this.duplicateShippingLine(ctx, shippingLine));
|
|
|
+ const newShippingLine = await this.duplicateShippingLine(ctx, shippingLine);
|
|
|
+ lines.map((line) => {
|
|
|
+ if(shippingLine.id === line.shippingLineId) {
|
|
|
+ line.shippingLineId = newShippingLine.id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ shippingLines.push(newShippingLine);
|
|
|
}
|
|
|
const sellerOrder = await this.connection.getRepository(ctx, Order).save(
|
|
|
new Order({
|