This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module.exports = {
3535 KAFKA_MESSAGE_ORIGINATOR : process . env . KAFKA_MESSAGE_ORIGINATOR || 'u-bahn-api' ,
3636
3737 // topics
38+ UBAHN_CREATE_USER_TOPIC : process . env . UBAHN_CREATE_TOPIC || 'user.action.topic.create' ,
3839 UBAHN_CREATE_TOPIC : process . env . UBAHN_CREATE_TOPIC || 'u-bahn.action.create' ,
3940 UBAHN_UPDATE_TOPIC : process . env . UBAHN_UPDATE_TOPIC || 'u-bahn.action.update' ,
4041 UBAHN_DELETE_TOPIC : process . env . UBAHN_DELETE_TOPIC || 'u-bahn.action.delete' ,
Original file line number Diff line number Diff line change 44
55const joi = require ( '@hapi/joi' )
66const _ = require ( 'lodash' )
7+ const config = require ( 'config' )
78
89const errors = require ( '../../common/errors' )
10+ const logger = require ( '../../common/logger' )
911const helper = require ( '../../common/helper' )
1012const dbHelper = require ( '../../common/db-helper' )
1113const serviceHelper = require ( '../../common/service-helper' )
@@ -33,7 +35,11 @@ async function create (entity, auth) {
3335 const result = await sequelize . transaction ( async ( t ) => {
3436 const userEntity = await dbHelper . create ( User , entity , auth , t )
3537 await serviceHelper . createRecordInEs ( resource , userEntity . dataValues , true )
36- return userEntity
38+ try {
39+ await helper . postEvent ( config . UBAHN_CREATE_USER_TOPIC , userEntity . dataValues )
40+ } catch ( err ) {
41+ logger . logFullError ( err )
42+ }
3743 } )
3844
3945 return result
You can’t perform that action at this time.
0 commit comments