Skip to content
Snippets Groups Projects
Commit 8d580f8b authored by Sebastian Mihalache's avatar Sebastian Mihalache :hammer_pick:
Browse files

fix(recommendationsEmails): EQA emails logic

parent 9995f79b
No related branches found
No related tags found
1 merge request!115Hin 1038
......@@ -145,16 +145,12 @@ module.exports = models => async (req, res) => {
const hasPeerReview = !isEmpty(collection.handlingEditor)
if (isEditorInChief) {
if (
recommendation === 'publish' &&
collection.technicalChecks.token &&
['accepted', 'inQA'].includes(collection.status)
) {
if (collection.status === 'inQA') {
notification.notifyEAWhenEiCRequestsEQAApproval()
} else {
notification.notifyEAWhenEiCMakesFinalDecision()
}
if (recommendation === 'publish' && collection.status === 'inQA') {
notification.notifyEAWhenEiCRequestsEQAApproval()
}
if (recommendation === 'publish' && collection.status === 'accepted') {
notification.notifyEAWhenEiCMakesFinalDecision()
}
if (hasPeerReview && (recommendation !== 'publish' || hasEQA)) {
......
......@@ -51,7 +51,6 @@ module.exports = ({ Collection, Fragment, User }) => async (req, res) => {
})
}
delete collection.technicalChecks.token
if (agree) {
if (step === TECHNICAL_STEPS.EQA) {
collection.technicalChecks.eqa = true
......@@ -61,6 +60,7 @@ module.exports = ({ Collection, Fragment, User }) => async (req, res) => {
}
}
delete collection.technicalChecks.token
collection.status = setNewStatus(step, agree)
await collection.save()
......
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