File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,21 @@ export const publishToEventBridge = ({ // eslint-disable-line import/prefer-defa
42
42
} : undefined ,
43
43
} ) ;
44
44
45
- const toPublishRequest = ( batchUow ) => ( {
46
- ...batchUow ,
47
- [ publishRequestField ] : {
48
- Entries : batchUow . batch
49
- . filter ( ( uow ) => uow [ publishRequestEntryField ] )
50
- . map ( ( uow ) => uow [ publishRequestEntryField ] ) ,
51
- EndpointId : endpointId || undefined ,
52
- } ,
53
- } ) ;
45
+ const toPublishRequest = ( batchUow ) => {
46
+ const Entries = batchUow . batch
47
+ . filter ( ( uow ) => uow [ publishRequestEntryField ] )
48
+ . map ( ( uow ) => uow [ publishRequestEntryField ] ) ;
49
+
50
+ return {
51
+ ...batchUow ,
52
+ [ publishRequestField ] : endpointId ? /* istanbul ignore next */ {
53
+ Entries,
54
+ EndpointId : endpointId ,
55
+ } : {
56
+ Entries,
57
+ } ,
58
+ } ;
59
+ } ;
54
60
55
61
const putEvents = ( batchUow ) => {
56
62
if ( ! batchUow [ publishRequestField ] . Entries . length ) {
You can’t perform that action at this time.
0 commit comments