File tree Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11machine :
22
33 node :
4- version : 5.9
4+ version : v5.7.0
55 environment :
66 DB_MASTER_URL : postgres://ubuntu:@127.0.0.1:5432/circle_test
77 # RABBITMQ_URL: amqp://localhost:5672
@@ -14,7 +14,7 @@ dependencies:
1414 pre :
1515 - pip install awsebcli
1616 override :
17- - npm install --only=dev
17+ - npm install
1818
1919deployment :
2020 development :
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const EVENT = {
3434 ROUTING_KEY : {
3535 PROJECT_MEMBER_ADDED : 'project.member.added' ,
3636 PROJECT_MEMBER_REMOVED : 'project.member.removed' ,
37+ PROJECT_MEMBER_UPDATED : 'project.member.updated' ,
3738
3839 PROJECT_DRAFT_CREATED : 'project.draft-created' ,
3940 PROJECT_LAUNCHED : 'project.launched' ,
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ module.exports = [
120120 let response = _ . cloneDeep ( newAttachment )
121121 response = _ . omit ( response , [ 'filePath' , 'deletedAt' ] )
122122
123- response . url = resp . data . result . content . preSignedURL
123+ response . downloadUrl = resp . data . result . content . preSignedURL
124124 res . status ( 201 ) . json ( util . wrapResponse ( req . id , response ) )
125125 } )
126126 . catch ( function ( err ) {
Original file line number Diff line number Diff line change @@ -134,10 +134,9 @@ describe('Project Attachments', () => {
134134 getSpy . should . have . been . calledOnce
135135 stub . restore ( )
136136 console . log ( JSON . stringify ( resJson , null , 2 ) )
137- // resJson.role.should.equal('customer')
138- // resJson.isPrimary.should.be.truthy
139- // resJson.projectId.should.equal(project1.id)
140- // resJson.userId.should.equal(1)
137+ resJson . title . should . equal ( 'Spec.pdf' )
138+ resJson . downloadUrl . should . exist
139+ resJson . projectId . should . equal ( project1 . id )
141140 done ( )
142141 } )
143142 } )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Joi from 'joi'
55
66import models from '../../models'
77import util from '../../util'
8- import { PROJECT_MEMBER_ROLE } from '../../constants'
8+ import { EVENT , PROJECT_MEMBER_ROLE } from '../../constants'
99import { middleware as tcMiddleware } from 'tc-core-library-js'
1010import directProject from '../../services/directProject'
1111
@@ -115,6 +115,11 @@ module.exports = [
115115 . then ( ( ) => {
116116 projectMember = projectMember . get ( { plain : true } )
117117 projectMember = _ . omit ( projectMember , [ 'deletedAt' ] )
118+ // emit original and updated project information
119+ req . app . emit ( EVENT . INTERNAL . PROJECT_MEMBER_UPDATED , {
120+ payload : { original : previousValue , updated : projectMember } ,
121+ props : { correlationId : req . id }
122+ } )
118123 req . log . debug ( 'updated project member' , projectMember )
119124 res . json ( util . wrapResponse ( req . id , projectMember ) )
120125 } )
You can’t perform that action at this time.
0 commit comments