Skip to content

Commit d9c2b08

Browse files
author
Parth Shah
committed
Merge branch 'release/v1.1.2'
2 parents 5495cc0 + 7b352ef commit d9c2b08

File tree

9 files changed

+8
-29
lines changed

9 files changed

+8
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tc-projects-service",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Projects microservice",
55
"main": "index.js",
66
"scripts": {

src/constants.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,3 @@ export const EVENT = {
4444
PROJECT_DELETED: 'project.deleted'
4545
}
4646
}
47-
EVENT.INTERNAL = _.mapValues(EVENT.ROUTING_KEY, (a) => { return `internal.${a}` })
48-
EVENT.EXTERNAL = _.mapValues(EVENT.ROUTING_KEY, (a) => { return `external.${a}` })

src/events/projects/index.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@ import {
55
import util from '../../util'
66
import topicService from '../../services/topicService'
77

8-
//
9-
// // Handle internal events
10-
// const internalEvents = [
11-
// EVENT.INTERNAL.PROJECT_DRAFT_CREATED,
12-
// EVENT.INTERNAL.PROJECT_LAUNCHED,
13-
// EVENT.INTERNAL.PROJECT_UPDATED,
14-
// EVENT.INTERNAL.PROJECT_CANCELLED,
15-
// EVENT.INTERNAL.PROJECT_COMPLETED,
16-
// EVENT.INTERNAL.PROJECT_DELETED
17-
// ]
18-
//
19-
// // Publish messages to the queue
20-
// _.map(internalEvents, (evt) => {
21-
// app.on(evt, ({payload, props}) => {
22-
// logger.debug('handling ' + evt)
23-
// let key = evt.substring(evt.indexOf('.') + 1)
24-
// return app.services.pubsub.publish(key, payload, props)
25-
// })
26-
// })
278
const _addProjectStatus = (req, logger, project) => {
289
const topics = [
2910
{
@@ -55,7 +36,7 @@ const _addProjectStatus = (req, logger, project) => {
5536
* @param {[type]} channel channel to ack, nack
5637
*/
5738
const projectCreatedHandler = (logger, msg, channel) => {
58-
let project = JSON.parse(msg.content.toString())
39+
let project = JSON.parse(msg.content)
5940
return util.getSystemUserToken(logger)
6041
.then(token => {
6142
const req = {

src/routes/projectMembers/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = [
6565
newMember = _newMember.get({plain: true})
6666
// publish event
6767
req.app.services.pubsub.publish(
68-
EVENT.INTERNAL.PROJECT_MEMBER_ADDED,
68+
EVENT.ROUTING_KEY.PROJECT_MEMBER_ADDED,
6969
newMember,
7070
{ correlationId: req.id }
7171
)

src/routes/projectMembers/delete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = [
3737
.then(member => {
3838
// fire event
3939
req.app.services.pubsub.publish(
40-
EVENT.INTERNAL.PROJECT_MEMBER_REMOVED,
40+
EVENT.ROUTING_KEY.PROJECT_MEMBER_REMOVED,
4141
member.get({plain:true}),
4242
{ correlationId: req.id }
4343
)

src/routes/projectMembers/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ module.exports = [
116116
projectMember = _.omit(projectMember, ['deletedAt'])
117117
// emit original and updated project information
118118
req.app.services.pubsub.publish(
119-
EVENT.INTERNAL.PROJECT_MEMBER_UPDATED,
119+
EVENT.ROUTING_KEY.PROJECT_MEMBER_UPDATED,
120120
{ original: previousValue, updated: projectMember },
121121
{ correlationId: req.id }
122122
)

src/routes/projects/delete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = [
3333
next(err)
3434
} else {
3535
req.app.services.pubsub.publish(
36-
EVENT.INTERNAL.PROJECT_DELETED,
36+
EVENT.ROUTING_KEY.PROJECT_DELETED,
3737
{ id: projectId },
3838
{ correlationId: req.id }
3939
)

src/routes/projects/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ module.exports = [
165165
previousValue = _.omit(previousValue, ['deletedAt'])
166166
// publish original and updated project data
167167
req.app.services.pubsub.publish(
168-
EVENT.INTERNAL.PROJECT_UPDATED,
168+
EVENT.ROUTING_KEY.PROJECT_UPDATED,
169169
{ original: previousValue, updated: project },
170170
{ correlationId: req.id }
171171
)

src/services/rabbitmq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module.exports = class RabbitMQService extends EventEmitter {
168168
new Buffer(JSON.stringify(payload)),
169169
props
170170
)
171-
self.logger.debug('Sent %s: %s', self.exchangeName, payload)
171+
self.logger.debug('Published msg to exchange %s with key: %s', self.exchangeName, key)
172172
return channel.close()
173173
})
174174
.catch((err) => {

0 commit comments

Comments
 (0)