File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -84,20 +84,22 @@ async function processUpdate (payload) {
84
84
if ( payload . status !== 'assigned' ) {
85
85
logger . info ( {
86
86
component : 'ResourceBookingEventHandler' ,
87
- context : 'selectJobCandidate ' ,
87
+ context : 'processUpdate ' ,
88
88
message : `not interested resource booking - status: ${ payload . status } `
89
89
} )
90
90
return
91
91
}
92
92
const resourceBooking = await models . ResourceBooking . findById ( payload . id )
93
- const job = await models . Job . findOne ( {
93
+ const jobs = await models . Job . findAll ( {
94
94
where : {
95
95
projectId : resourceBooking . projectId ,
96
96
deletedAt : null
97
97
}
98
98
} )
99
- await selectJobCandidate ( job . id , resourceBooking . userId )
100
- await assignJob ( job )
99
+ for ( const job of jobs ) {
100
+ await selectJobCandidate ( job . id , resourceBooking . userId )
101
+ await assignJob ( job )
102
+ }
101
103
}
102
104
103
105
module . exports = {
You can’t perform that action at this time.
0 commit comments