@@ -181,17 +181,17 @@ module.exports = (app, logger) => {
181
181
* If the project is in draft status and the phase is in reviewed status, and it's the
182
182
* only phase in the project with that status, then send the plan ready event.
183
183
*
184
- * @param req
185
- * @param project
186
- * @param phase
184
+ * @param req the req
185
+ * @param project the project
186
+ * @param phase the phase that was created/updated
187
187
* @returns {Promise<void> }
188
188
*/
189
189
async function sendPlanReadyEventIfNeeded ( req , project , phase ) {
190
190
if ( project . status === PROJECT_STATUS . DRAFT &&
191
191
phase . status === PROJECT_PHASE_STATUS . REVIEWED ) {
192
192
models . ProjectPhase . count ( {
193
- where : { projectId : project . id , status : PROJECT_PHASE_STATUS . REVIEWED }
194
- } ) . then ( ( count => {
193
+ where : { projectId : project . id , status : PROJECT_PHASE_STATUS . REVIEWED } ,
194
+ } ) . then ( ( ( count ) => {
195
195
// only send the plan ready event when this is the only reviewed phase in the project
196
196
if ( count !== 1 ) { return ; }
197
197
createEvent ( BUS_API_EVENT . PROJECT_PLAN_READY , {
@@ -200,7 +200,7 @@ module.exports = (app, logger) => {
200
200
projectName : project . name ,
201
201
userId : req . authUser . userId ,
202
202
initiatorUserId : req . authUser . userId ,
203
- } , logger )
203
+ } , logger ) ;
204
204
} ) ) ;
205
205
}
206
206
}
@@ -278,7 +278,7 @@ module.exports = (app, logger) => {
278
278
] . forEach ( ( [ key , events , sendIfEqual ] ) => {
279
279
// eslint-disable-next-line no-param-reassign
280
280
events = Array . isArray ( events ) ? events : [ events ] ;
281
-
281
+
282
282
// send event(s) only if the target field's value was updated, or when an update matches a "sendIfEqual" value
283
283
if ( ( ! sendIfEqual && ! _ . isEqual ( original [ key ] , updated [ key ] ) ) ||
284
284
( original [ key ] !== sendIfEqual && updated [ key ] === sendIfEqual ) ) {
0 commit comments