Skip to content

Commit 96b49e0

Browse files
author
John Gilbert
committed
add-eb-global-support
1 parent 57e0067 commit 96b49e0

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/sinks/eventbridge.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,21 @@ export const publishToEventBridge = ({ // eslint-disable-line import/prefer-defa
4242
} : undefined,
4343
});
4444

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+
};
5460

5561
const putEvents = (batchUow) => {
5662
if (!batchUow[publishRequestField].Entries.length) {

0 commit comments

Comments
 (0)