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