Skip to content

Commit a57a26c

Browse files
authored
Add userId to all events
1 parent 58ade2c commit a57a26c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/events/busApi.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ module.exports = (app, logger) => {
2020
/**
2121
* PROJECT_DRAFT_CREATED
2222
*/
23-
app.on(EVENT.ROUTING_KEY.PROJECT_DRAFT_CREATED, ({ project }) => {
23+
app.on(EVENT.ROUTING_KEY.PROJECT_DRAFT_CREATED, ({ req, project }) => {
2424
logger.debug('receive PROJECT_DRAFT_CREATED event');
2525

2626
// send event to bus api
2727
createEvent(BUS_API_EVENT.PROJECT_CREATED, {
2828
projectId: project.id,
2929
projectName: project.name,
30+
userId: req.authUser.userId
3031
});
3132
});
3233

@@ -41,6 +42,7 @@ module.exports = (app, logger) => {
4142
createEvent(mapEventTypes[updated.status], {
4243
projectId: updated.id,
4344
projectName: updated.name,
45+
userId: req.authUser.userId,
4446
});
4547
} else if (
4648
!_.isEqual(original.details, updated.details) ||

0 commit comments

Comments
 (0)