@@ -1512,7 +1512,6 @@ export class OrderingService
1512
1512
try {
1513
1513
if ( this . fulfillment_service ) {
1514
1514
this . logger ?. debug ( 'Evaluate fulfillment on submit...' ) ;
1515
- response . fulfillments = [ ] ;
1516
1515
const fulfillment_map : Record < string , FulfillmentResponse > = { } ;
1517
1516
await this . _evaluateFulfillment (
1518
1517
{
@@ -1534,13 +1533,12 @@ export class OrderingService
1534
1533
r => {
1535
1534
r . items ?. forEach (
1536
1535
fulfillment => {
1537
- const id = fulfillment . payload ?. references ?. [ 0 ] ?. instance_id
1538
- ?? fulfillment . status ?. id ;
1536
+ const id = fulfillment . payload ?. references ?. [ 0 ] ?. instance_id ;
1539
1537
const order = response_map [ id ] ;
1540
1538
if ( order && fulfillment . status ?. code !== 200 ) {
1541
1539
order . status = fulfillment . status ;
1542
1540
}
1543
- fulfillment_map [ id ] = fulfillment ;
1541
+ fulfillment_map [ id ] = fulfillment ;
1544
1542
}
1545
1543
) ;
1546
1544
@@ -1559,7 +1557,7 @@ export class OrderingService
1559
1557
throw error ;
1560
1558
}
1561
1559
) . finally (
1562
- ( ) => response . fulfillments . push ( ... Object . values ( fulfillment_map ) )
1560
+ ( ) => response . fulfillments = Object . values ( fulfillment_map )
1563
1561
) ;
1564
1562
1565
1563
this . logger ?. debug ( 'Create fulfillment on submit...' ) ;
@@ -1583,7 +1581,7 @@ export class OrderingService
1583
1581
r => {
1584
1582
r . items ?. forEach (
1585
1583
fulfillment => {
1586
- const id = fulfillment . payload ?. references ?. [ 0 ] ?. instance_id ?? fulfillment . status ?. id ;
1584
+ const id = fulfillment . payload ?. references ?. [ 0 ] ?. instance_id ;
1587
1585
const order = response_map [ id ] ;
1588
1586
if ( order && fulfillment . status ?. code !== 200 ) {
1589
1587
order . status = fulfillment . status ;
@@ -1608,7 +1606,7 @@ export class OrderingService
1608
1606
throw error ;
1609
1607
}
1610
1608
) . finally (
1611
- ( ) => response . fulfillments . push ( ... Object . values ( fulfillment_map ) )
1609
+ ( ) => response . fulfillments = Object . values ( fulfillment_map )
1612
1610
) ;
1613
1611
}
1614
1612
0 commit comments