Skip to content
Snippets Groups Projects
Commit eed6c9d2 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

fix(emails): fix EiC reject decision

parent d827b4e1
No related branches found
No related tags found
2 merge requests!34Sprint 17 features,!26fix(emails): fix author recieving wrong email
const config = require('config')
const { chain, get } = require('lodash')
const { chain, get, isEmpty } = require('lodash')
const {
User,
......@@ -58,9 +58,13 @@ module.exports = {
comments = eicComments
}
const hasPeerReview = (collection = {}) =>
!isEmpty(collection.handlingEditor)
if (
(isEditorInChief || newRecommendation.recommendationType === 'review') &&
collection.status !== 'rejected'
hasPeerReview(collection)
) {
// the request came from either the Editor in Chief or a reviewer, so the HE needs to be notified
sendHandlingEditorEmail({
......@@ -93,7 +97,7 @@ module.exports = {
newRecommendation,
})
}
if (collection.status !== 'rejected') {
if (hasPeerReview(collection)) {
sendReviewersEmail({
email,
baseUrl,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment